|
-
Jul 29th, 2003, 06:21 AM
#1
Thread Starter
Addicted Member
Disable MDIForm 'X'
How can i disable the 'X' at the top right hand corner of an MDI Form?
-
Jul 29th, 2003, 07:16 AM
#2
Not NoteMe
I'm not sure if you can actually remove it, but you should be able to stop it working...
VB Code:
Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = 0 then Cancel = 1
End Sub
If unloadmode is 0 then the form's trying to close because the user clicked on the close button.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Jul 29th, 2003, 07:27 AM
#3
VB Code:
Option Explicit
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, _
ByVal nPosition As Long, _
ByVal wFlags As Long) _
As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, _
ByVal bRevert As Long) _
As Long
Private Const MF_BYCOMMAND = &H0&
Private Const SC_CLOSE = &HF060&
Private Sub MDIForm_Load()
Dim hMnu As Long
hMnu = GetSystemMenu(Me.hwnd, False)
Call RemoveMenu(hMnu, SC_CLOSE, MF_BYCOMMAND)
End Sub
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Aug 20th, 2004, 07:10 AM
#4
its too good man
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|