Void btnLogin Click(System:: Object sender, System:: EventArgs e)


Download 304.74 Kb.
Sana19.06.2023
Hajmi304.74 Kb.
#1623675
Bog'liq
Munira 13



Form1 kodlari
void btnLogin_Click(System::Object^ sender, System::EventArgs^ e)
{
String^ password = txtPassword->Text;
if (password == "Munira")
{
Form2^ form2 = gcnew Form2();
form2->Show();
}
else
{
MessageBox::Show("Parol xato.", "Xato", MessageBoxButtons::OK, MessageBoxIcon::Error);
}
}
Form2 kodlari

void btnCalculate_Click(System::Object^ sender, System::EventArgs^ e)


{
int month = Convert::ToInt32(txtMonth->Text);
int year = Convert::ToInt32(txtYear->Text);

if (month < 1 || month > 12 || year < 1)


{
MessageBox::Show("Invalid month or year.", "Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
return;
}
int daysInMonth = DateTime::DaysInMonth(year, month);
String^ message = String::Format("Number of days in {0}/{1}: {2}", month, year, daysInMonth);
MessageBox::Show(message, "Day Count", MessageBoxButtons::OK, MessageBoxIcon::Information);
}


Natija

Download 304.74 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling