1. #pragma once
  2.  
  3.  
  4. namespace button {
  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. ///
  16. /// WARNING: If you change the name of this class, you will need to change the
  17. /// 'Resource File Name' property for the managed resource compiler tool
  18. /// associated with all .resx files this class depends on. Otherwise,
  19. /// the designers will not be able to interact properly with localized
  20. /// resources associated with this form.
  21. /// </summary>
  22. public ref class Form1 : public System::Windows::Forms::Form
  23. {
  24. public:
  25. Form1(void)
  26. {
  27. InitializeComponent();
  28. //
  29. //TODO: Add the constructor code here
  30. //
  31. }
  32.  
  33. protected:
  34. /// <summary>
  35. /// Clean up any resources being used.
  36. /// </summary>
  37. ~Form1()
  38. {
  39. if (components)
  40. {
  41. delete components;
  42. }
  43. }
  44. private: System::Windows::Forms::Button^ button1;
  45. protected:
  46. private: System::Windows::Forms::ListBox^ listBox1;
  47.  
  48. private:
  49. /// <summary>
  50. /// Required designer variable.
  51. /// </summary>
  52. System::ComponentModel::Container ^components;
  53.  
  54. #pragma region Windows Form Designer generated code
  55. /// <summary>
  56. /// Required method for Designer support - do not modify
  57. /// the contents of this method with the code editor.
  58. /// </summary>
  59. void InitializeComponent(void)
  60. {
  61. this->button1 = (gcnew System::Windows::Forms::Button());
  62. this->listBox1 = (gcnew System::Windows::Forms::ListBox());
  63. this->SuspendLayout();
  64. //
  65. // button1
  66. //
  67. this->button1->Location = System::Drawing::Point(225, 81);
  68. this->button1->Name = L"button1";
  69. this->button1->Size = System::Drawing::Size(182, 170);
  70. this->button1->TabIndex = 0;
  71. this->button1->Text = L"button1";
  72. this->button1->UseVisualStyleBackColor = true;
  73. this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
  74. //
  75. // listBox1
  76. //
  77. this->listBox1->FormattingEnabled = true;
  78. this->listBox1->Location = System::Drawing::Point(12, 24);
  79. this->listBox1->Name = L"listBox1";
  80. this->listBox1->Size = System::Drawing::Size(181, 199);
  81. this->listBox1->TabIndex = 1;
  82. //
  83. // Form1
  84. //
  85. this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  86. this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  87. this->ClientSize = System::Drawing::Size(504, 410);
  88. this->Controls->Add(this->listBox1);
  89. this->Controls->Add(this->button1);
  90. this->Name = L"Form1";
  91. this->Text = L"Form1";
  92. this->ResumeLayout(false);
  93.  
  94. }
  95. #pragma endregion
  96. private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
  97. listBox1->Items->Add(String::Format(gcnew System::String("AJPOH")));
  98. }
  99. };
  100. }
  101.  
  102.