End with button click - Vb

End with click

Snippet Code


  
Rate this page :
  [ 0 votes]

End your application with a button click.Change the name of the button (Command1) to the name of your button.

Private Sub Command1_Click() Dim frm as Form 'First we want to loop through all the 'Forms and close them (We close the current Form last) For Each frm In Forms 'Make sure we arent looking at the current Form If frm.hWnd <> Me.hWnd Then 'Unload this Form Unload frm Set frm = Nothing End If 'Now get the next Form Next frm 'Now unload the current Form Unload Me End Sub

Tags


Ask Questions

Ask Question