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

Recommended Answers

All 4 Replies

Learn to read MSDN articles You will have to test each checkbox to determine its state (checked or unchecked)

Where can I find anything useful inside it...

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 );
                     
                 }
             }

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.