niedziela, 4 czerwca 2023

Title Form Application - Visual C++

 



private:

Form^ my_T;


private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {

my_T = gcnew Form;

int w, h,centr_X,centr_Y;

Label^ text1;

Label^ text2;

Button^ close_B = gcnew Button;

text1 = gcnew Label;

text2 = gcnew Label;

System::Drawing::Font^ font1=gcnew 

System::Drawing::Font(System::Drawing::FontFamily::GenericSansSerif, 18, FontStyle::Bold);

System::Drawing::Font^ font2 = gcnew

System::Drawing::Font(System::Drawing::FontFamily::GenericSansSerif, 22, FontStyle::Italic);

        my_T->Width = 601; my_T->Height = 301;

w = my_T->Width; h = my_T->Height;

centr_X = w / 2;

centr_Y = h / 2;

text1->Text = "Version 1.0";

text2->Text = "Author:  lukasz.wierzbicki2@gmail.com";

text1->Font = font1;

text2->Font = font2;

text1->AutoSize = true;

text2->AutoSize = true;

text1->Location = Point(centr_X-300, centr_Y-100);

text2->Location = Point(centr_X-300, (centr_Y-100) + 30);

close_B->Text = "CLOSE";

close_B->Location = Point(centr_X - 50, (centr_Y - 100) + 180);

close_B->AutoSize = true;

my_T->Text = "Title Aplication: ";

my_T->Controls->Add(text1);

my_T->Controls->Add(text2);

my_T->Controls->Add(close_B);

my_T->TopMost = true;

close_B->Click += gcnew EventHandler(this, &Form1::close_B_Click);

my_T->Show();

}

private: System::Void close_B_Click(System::Object^ sender, System::EventArgs^ e)

{

my_T->Close();

}