-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenuForm.cpp
37 lines (30 loc) · 970 Bytes
/
MenuForm.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "MenuForm.h"
#include "GameForm.h"
#include "AboutMeForm.h"
namespace oczko {
System::Void MenuForm::StartButton_Click(System::Object^ sender, System::EventArgs^ e)
{
try {
float startMoney = Single::Parse(StartMoneyTextBox->Text);
if (startMoney <= 0)
throw gcnew System::Exception("Start money has to be bigger than 0.");
if (player_name_textbox->Text->Length < 1)
throw gcnew System::Exception("Player name can't be empty.");
Hide();
GameForm^ gameForm = gcnew GameForm(startMoney, player_name_textbox->Text);
gameForm->Show();
}
catch (System::Exception^ e) {
MessageBox::Show(e->Message);
}
}
System::Void MenuForm::exitToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
Application::Exit();
}
System::Void MenuForm::aboutMeToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
AboutMeForm^ aboutMeForm = gcnew AboutMeForm();
aboutMeForm->ShowDialog();
}
}