|
-
Nov 23rd, 2000, 02:31 AM
#1
Thread Starter
Lively Member
I've used DeleteMenu to delete the X button for my MDI-child form. But when it comes to Maximized the MDI-child form a person can still close the form when they cliked on the disabled X button.
-
Nov 23rd, 2000, 10:03 AM
#2
This code is from Megatron which will allow you to disable the x button.
Code:
Private Declare Function GetSystemMenu Lib "User32" _
(ByVal hWnd As Integer, ByVal bRevert As Integer) As Integer
Private Declare Function RemoveMenu Lib "User32" (ByVal _
hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags _
As Integer) As Integer
Const MF_BYPOSITION = &H400
Private Sub Form_Load()
RemoveMenu GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION 'Disable Close
End Sub
-
Nov 23rd, 2000, 10:49 AM
#3
Fanatic Member
Originally posted by Matthew Gates
Code:
RemoveMenu GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION 'Disable Close
[/B]
Why is that line green?
-
Nov 23rd, 2000, 11:59 AM
#4
Remove
Rem
^Color coding
Code:
RemoveMenu GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION
Code:
RemoveMenu GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION 'Disable Close
This was brought up by Yonatan to John in the Feedback Forums.
Try searching for it if you really want to know more .
-
Nov 23rd, 2000, 12:08 PM
#5
Code:
Private Sub Form_Load()
RemoveMenu GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION 'Disable Close
End Sub
Code:
Private Sub Form_Load()
RemoveMenu GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION
End Sub
There we go, it is either one of theses lines:
Private Sub Form_Load()
or
End Sub.
Code:
Private Sub Form_Load()
RemoveMenu GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION
Code:
RemoveMenu GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION
End Sub
Sorry for the useless posting, but this cannot remain an unsolved mystery .
And Private Sub Form_Load(), it is! Mystery Solved--Half way.
Code:
Private
RemoveMenu GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION
Code:
Sub
RemoveMenu GetSystemMenu(hWnd, 0), 6, MF_BYPOSITION
-
Nov 23rd, 2000, 03:30 PM
#6
I believe Vb-World this of Remove as Rem which is equal to ' (used for commenting).
Code:
Private Sub Command1_Click()
Rem This is a comment
End Sub
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
|