0

I have composed a Windows Forms Application with few Check Boxes and Install button on it as well. Now I just made a code for Install button's Event Handler which run application when button is clicked. Code is following, and was just made for test if everything works as supposed to.

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
			 ProcessStartInfo^ startInfo = gcnew ProcessStartInfo( "WinRar.bat" );
					startInfo->WindowStyle = ProcessWindowStyle::Normal;
					Process::Start( startInfo );

					Form4 ^fsecondForm = gcnew Form4();	//next step
					this->Hide();
					fsecondForm->Show();

Now I want that Install button run only applications which has checked check box. So, If check box1 is checked then run filename1.exe. What code should I use to do it, is there any nice tutorial?
Thanks

Attachments 01.jpg 117.84 KB
2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by kustrle
0

Like this:

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
                 if( checkBox1->Checked)
                 {
MessageBox::Show( "CheckBox1 was chedked.", "Warning",
            MessageBoxButtons::OK, MessageBoxIcon::Exclamation );
                     
                 }
                 if( checkBox2->Checked)
                 {
MessageBox::Show( "CheckBox2 was chedked.", "Warning",
            MessageBoxButtons::OK, MessageBoxIcon::Exclamation );
                     
                 }
             }
0

Well, it actually helped me. But I looked again at link you gave me - I couldn't find that code in examples...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.