Toolbar exit button "X"

Polar Bear
03-05-2003, 05:26 PM
How can I write events for the Titlebar exit button?

I want to launch a procedure when it is clicked

ex.

Private Sub TitleBarExit_Click()
'Do whatever
End Sub

John
03-05-2003, 05:41 PM
Private Sub ToolbarExit_Click()
Unload Me
End Sub

Polar Bear
03-05-2003, 05:50 PM
i need to know what is the name of the toolbar exit control

it's not ToolbarExit

maybe TitleBarExit? nope that doesn't work either

Volte
03-05-2003, 05:55 PM
Use the QueryUnload event.Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
MsgBox "The 'X' button was clicked!"
End If
End Sub

John
03-05-2003, 06:26 PM
i need to know what is the name of the toolbar exit control

it's not ToolbarExit

maybe TitleBarExit? nope that doesn't work either
Sorry, your use of the word ToolBar made me think you were talking about a ToolBar you had placed on the form, not the TitleBar of the form :-\

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum