Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Base Form with button - need to handle event

Status
Not open for further replies.

XTnCIS

Programmer
Apr 23, 2002
57
0
0
US
I want to have a base form where I define a button (btnExit) through the code and the base form contains an event handler to execute me.close

I have the base form created. I can create the button through code and I used the
Public WithEvents BtnExit as system.windows.forms.button

I created a sub with me.close that has the 'handles BtnExit.Click' statement.

But... when I 'run' a child form, I can see the Exit button but clicking it doesn't do anything.

Can anyone help me. What do I have to do to get the child form to use the sub from the base form that should execute the me.close statement?
 
Use Dispose() or Application.Exit or End instead of Close().

Dispose only kills the active form.

Application.Exit and End kill the program.

I hope this helps.

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top