0

i made a reservation system and in first form user should choose [One Way] or [Round Trip]
[one way or round trip as radiobuttons ].if user choosed round trip should fill form2 befor submit
but my issue [if the user after choosed round trip then form2 opend ,user closed the form2 i want in this case the system made one way radio button checked by default in form1]

Thank you

Edited by amr_asd5: n/a

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Mitja Bonca
0

Hi,

1. Declare a static variable bool m_bReturnTripIsSelected in the first form.
2. Declare the

private void Form1_Activated(object sender, System.EventArgs e) 
{
if(m_bReturnTripSelected)
{
returnTripRbutton.Enabled = true;
}
}

- this will fire once the form is focused - [http://msdn.microsoft.com/en-us/library/system.windows.forms.form.activate(VS.71).aspx]
3. On Form2_FormClosing call the static property for m_bReturnTripIsActive and set it true (if round trip failed).


Hope this helps.

0

sorry correction [at point 3]
3. On Form2_FormClosing call the static property for m_bReturnTripIsSelected and set it true (if round trip failed).

0

Or you can use delegates, which will call some method on form where you have radioButton, which will be checked before form from where is it called, will close.

This topic has been dead for over six months. 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.