I have a main window which calls a sub screen. When the sub screen is done I
need to return to the main screen. In my file menu I have a return/exit
option. Can someone tell me how to code the return?? I know this works for
buttons but I do not know how to do this with a menuitem. Help
//
// btReturn
//
this.btReturn.DialogResult = ms.DialogResult.OK;
this.btReturn.Index = 2;
this.btReturn.Text = "&Return";
this.btReturn.Click += new System.EventHandler(this.btReturn_Click);
"nbohana" <nbohana@discussions.microsoft.com> schrieb:
>I have a main window which calls a sub screen. When the sub screen is done
>I
> need to return to the main screen. In my file menu I have a return/exit
> option. Can someone tell me how to code the return?? I know this works
> for
> buttons but I do not know how to do this with a menuitem.
If the main screen is still visible, simply call the sub screen's 'Close'
method in the button's 'Click' event ('this.Close();').

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Maqsood Ahmed - 29 Apr 2005 10:18 GMT
Hello,
If you want the routine/method to continue from where it left (after
displaying the sub screen).. you can use Form's ShowDialog method.
something like:
if(subForm.ShowDialog() == DialogResult.OK)
//Do Something
else
//Do something else
HTH. :)
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net