Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
How do you handle the click of the "x" in the top corner to close the application? How do you unload the application? I can do it with a button click but how do I do it with the "x"?

Thanks,

Tehon

Posted
No, I haven't but something must still be open. How do you close a form when a button is clicked? In VB6 I used Unload Me but in .NET you can't. What should i be doing?

Thanks,

Tehon

  • Leaders
Posted

if you want the whole application to close then use this...

    Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
       End
   End Sub

if you want to unload just the 1 form then i'd use the way of showing the form as divil showed above "Dim frm as form"

then i'd do something like...

    Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
       Set frm = nothing
   End Sub

  • 2 months later...
Posted

Dim myForm as FrmTest = New FrmTest

 

myForm is the name of a variable (container) for your form, FrmTest is the name of the class of your Form, New FrmTest in to create a new instance of the class (form) inside the container, in this case myForm

Fat kids are harder to kidnap

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...