Pemrograman C++ Dasar-Dasar Aplikasi Windows

Pemrograman C++ Dasar-Dasar Aplikasi Windows

Pemrograman C++ Dasar-Dasar Aplikasi Windows

Pemrograman C++ Dasar-Dasar Aplikasi Windows

Pada kesempatan kali ini admin freakprogrammer akan membagikan source code dasar-dasar aplikasi windows di bahasa pemograman c++ langsung saja.

Pemrograman C++ Dasar-Dasar Aplikasi Windows


Source code
  1. #pragma once
  2. namespace modul9 {
  3.  using namespace System;
  4.  using namespace System::ComponentModel;
  5.  using namespace System::Collections;
  6.  using namespace System::Windows::Forms;
  7.  using namespace System::Data;
  8.  using namespace System::Drawing;
  9.  /// <summary>
  10.  /// Summary for Form1
  11.  /// </summary>
  12.  public ref class Form1 : public System::Windows::Forms::Form
  13.  {
  14.  public:
  15.   Form1(void)
  16.   {
  17.    InitializeComponent();
  18.    //
  19.    //TODO: Add the constructor code here
  20.    //
  21.   }
  22.  protected:
  23.   /// <summary>
  24.   /// Clean up any resources being used.
  25.   /// </summary>
  26.   ~Form1()
  27.   {
  28.    if (components)
  29.    {
  30.     delete components;
  31.    }
  32.   }
  33.  private: System::Windows::Forms::Button^  button1;
  34.  private: System::Windows::Forms::Button^  button2;
  35.  protected:
  36.  private:
  37.   /// <summary>
  38.   /// Required designer variable.
  39.   /// </summary>
  40.   System::ComponentModel::Container ^components;
  41. #pragma region Windows Form Designer generated code
  42.   /// <summary>
  43.   /// Required method for Designer support - do not modify
  44.   /// the contents of this method with the code editor.
  45.   /// </summary>
  46.   void InitializeComponent(void)
  47.   {
  48.    this->button1 = (gcnew System::Windows::Forms::Button());
  49.    this->button2 = (gcnew System::Windows::Forms::Button());
  50.    this->SuspendLayout();
  51.    //
  52.    // button1
  53.    //
  54.    this->button1->Location = System::Drawing::Point(12181);
  55.    this->button1->Name = L"button1";
  56.    this->button1->Size = System::Drawing::Size(8622);
  57.    this->button1->TabIndex = 0;
  58.    this->button1->Text = L"Mulai";
  59.    this->button1->UseVisualStyleBackColor = true;
  60.    this->button1->Click += gcnew System::EventHandler(this&Form1::button1_Click);
  61.    //
  62.    // button2
  63.    //
  64.    this->button2->Location = System::Drawing::Point(116181);
  65.    this->button2->Name = L"button2";
  66.    this->button2->Size = System::Drawing::Size(8921);
  67.    this->button2->TabIndex = 1;
  68.    this->button2->Text = L"Selesai";
  69.    this->button2->UseVisualStyleBackColor = true;
  70.    this->button2->Click += gcnew System::EventHandler(this&Form1::button2_Click);
  71.    //
  72.    // Form1
  73.    //
  74.    this->AutoScaleDimensions = System::Drawing::SizeF(613);
  75.    this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  76.    this->ClientSize = System::Drawing::Size(284261);
  77.    this->Controls->Add(this->button2);
  78.    this->Controls->Add(this->button1);
  79.    this->Name = L"Form1";
  80.    this->Text = L"Form1";
  81.    this->ResumeLayout(false);
  82.   }
  83. #pragma endregion
  84.  private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
  85.      MessageBox::Show("Hallo Semua, Saya sedang belajar C++");
  86.     }
  87.  private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
  88.      this->Close();
  89.     }
  90.  };
  91. }

Itulah source code Pemrograman C++ Dasar-Dasar Aplikasi Windows Semoga bermanfaat.
Buka Komentar