fork download
  1. #pragma once
  2. #include "Form2.h"
  3.  
  4. namespace marketProject {
  5.  
  6. using namespace System;
  7. using namespace System::ComponentModel;
  8. using namespace System::Collections;
  9. using namespace System::Windows::Forms;
  10. using namespace System::Data;
  11. using namespace System::Drawing;
  12.  
  13. /// <summary>
  14. /// Summary for Form1
  15. /// </summary>
  16. public ref class Form1 : public System::Windows::Forms::Form
  17. {
  18. public:
  19. Form1(void)
  20. {
  21. InitializeComponent();
  22. //
  23. //TODO: Add the constructor code here
  24. //
  25. }
  26.  
  27. protected:
  28. /// <summary>
  29. /// Clean up any resources being used.
  30. /// </summary>
  31. ~Form1()
  32. {
  33. if (components)
  34. {
  35. delete components;
  36. }
  37. }
  38. private: System::Windows::Forms::Button^ button1;
  39. private: System::Windows::Forms::Label^ label1;
  40. protected:
  41.  
  42. protected:
  43.  
  44. private:
  45. /// <summary>
  46. /// Required designer variable.
  47. /// </summary>
  48. System::ComponentModel::Container ^components;
  49.  
  50. #pragma region Windows Form Designer generated code
  51. /// <summary>
  52. /// Required method for Designer support - do not modify
  53. /// the contents of this method with the code editor.
  54. /// </summary>
  55. void InitializeComponent(void)
  56. {
  57. this->button1 = (gcnew System::Windows::Forms::Button());
  58. this->label1 = (gcnew System::Windows::Forms::Label());
  59. this->SuspendLayout();
  60. //
  61. // button1
  62. //
  63. this->button1->Location = System::Drawing::Point(91, 50);
  64. this->button1->Name = L"button1";
  65. this->button1->Size = System::Drawing::Size(75, 23);
  66. this->button1->TabIndex = 0;
  67. this->button1->Text = L"Push me";
  68. this->button1->UseVisualStyleBackColor = true;
  69. this->button1->Click += gcnew System::EventHandler(this, &Form1::Button1_Click);
  70. //
  71. // label1
  72. //
  73. this->label1->AutoSize = true;
  74. this->label1->Location = System::Drawing::Point(173, 119);
  75. this->label1->Name = L"label1";
  76. this->label1->Size = System::Drawing::Size(35, 13);
  77. this->label1->TabIndex = 1;
  78. this->label1->Text = L"Greetings, traveller";
  79. //
  80. // Form1
  81. //
  82. this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  83. this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  84. this->ClientSize = System::Drawing::Size(284, 261);
  85. this->Controls->Add(this->label1);
  86. this->Controls->Add(this->button1);
  87. this->Name = L"Form1";
  88. this->Text = L"Form1";
  89. this->ResumeLayout(false);
  90. this->PerformLayout();
  91.  
  92. }
  93. #pragma endregion
  94.  
  95. private: System::Void Button1_Click(System::Object^ sender, System::EventArgs^ e) {
  96. label1->Text = "Hello there";
  97. this->label1->Location = System::Drawing::Point(0, 0);
  98. Form2^ f2 = gcnew Form2(this);
  99. f2->Show();
  100. this->Hide();
  101. }
  102. };
  103. }
  104.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:9: warning: #pragma once in main file
 #pragma once
         ^~~~
prog.cpp:2:19: fatal error: Form2.h: No such file or directory
 #include "Form2.h"
                   ^
compilation terminated.
stdout
Standard output is empty