Please help me with this issue:
I want to make an "Options" form (Form2) for a program in which Form1 is the main form.
Consider 2 forms
Form1: The main form
Contains: - Button1: Which I want it to open Form2 when clicked.
- Label1: Text label which is determined by the selection of radio buttons in form2
Form2: the Options form
Contains: - RadioButton1: If selected, change the text of Label1 to "Pathology"
- RadioButton2: If selected, change the text of Label1 to "Endocrinology"
-ButtonClose: Close Form2
Thanks alot
Bechir BejaouiPosted Mar 22, 2008, 5:53 AM
public class Choise
{
public static bool Alternative;
}
In form 2:
Add this block
if(radio1.checked)
{
Choise.Alternative = true;
}
if(radio2.checked)
{
Choise.Alternative = false;
}
In the Form1
add this:
in the button event handler add this
Form2 oForm = new Form2();
oForm.Show();
oForm.dispose += this.Disposed +=new EventHandler(Form2_Disposed);
implement the
public Form2_Disposed(Object sender , EventArgs e)
{
if(Choise.Alternative == true) label.Text = "put what you awant here";
if(Choise.Alternative == false) label.Text = "put what you want here";
}