1. Form "Close Button" - top right "X" - Visual Basic/VB
2. Closing app in IDE from close (X box) at top right hand corner
Hi All, I have had this problem a number of times. I have an app that is working just fine, however the only issue is that I cannot close the app by clicking the standard windows X (To right hand corner) if running within the IDE. I have tried to trap the forms unload, deactivate events but no, nothing. I compile the app and all works fine. You may say thats all that is needed, however, I am intreaged as to why I can't close within the IDE. I have to use a menu or command button! Help!!!!!!! Regards matt A
3. Dialog Box is open, close and continue - forms with outlook qu
4. Dialog Box is open, close and continue - forms with outlook questi
5. contols top(left & right) edges rounded (imitating a form)
6. Form: disable Close button and remove Close menu and then reactivate
In Vs2005 i need to disable the Close button and remove Close Menu and then
reactivate them.
I have found how to disable Close button and remove close menu, but i
haven't found how to reactivate them.
Does someone knows how to reactivate them?
This is how i disable close button and remove close menu:
<DllImport("user32.dll")> Private Shared Function GetSystemMenu(ByVal hWnd
As IntPtr, ByVal wMsg As Boolean) As IntPtr
End Function
<DllImport("user32.dll")> Private Shared Function RemoveMenu(ByVal hWnd As
IntPtr, ByVal uPosition As Int32, ByVal uFlags As Int32) As Boolean
End Function
<DllImport("user32.dll")> Private Shared Function SendMessage(ByVal hWnd As
IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32)
As Int32
End Function
Private Const SC_CLOSE As Int32 = &HF060
Private Const MF_BYCOMMAND As Int32 = 0
Private Const WM_NCACTIVATE As Int32 = &H86
Private Sub DeactivateCloseButtonAndMenu()
Dim hMenu As IntPtr
hMenu = GetSystemMenu(Me.Handle, False)
RemoveMenu(hMenu, SC_CLOSE, MF_BYCOMMAND)
SendMessage(Me.Handle, WM_NCACTIVATE, 0, 0)
SendMessage(Me.Handle, WM_NCACTIVATE, 1, 0)
End Sub
Thanks.
7. Form closing after button click
8. Close a form by pressing esc, how to do it without having a button
Hello there, I was wondering if anyone knew how to close a form when the user presses the esc key. I dont have any buttons on the form so I cannot use the cancelButton property of the form. I have tried using the forms keypressed event but it doesnt seem to be firing. Does anyone have any suggestins? Thank you John Sheppard