|
-
December 4th, 2003, 03:18 PM
#1
changing window properties ?
I would like to disable the 'X' (close window in upper right corner) on a main window of an application. Can I do this ? All I have is the window handle passed in from another application. Thanks in advance.
-
December 4th, 2003, 03:41 PM
#2
Set the ControlBox property to False, but that's going to disable your Minimize and Maximize as well.
-
December 4th, 2003, 03:42 PM
#3
The code assumes one Form and a command button named Command1. The code below will suppress clicking on the X on the top right corner as well as <Alt><F4> key presses. The only way to unload the form is clicking Command1 button or from the Task Manger I reckon.
Code:
Option Explicit
Dim bUnload As Boolean
Private Sub Command1_Click()
bUnload = True
Unload Me
End Sub
Private Sub Form_Load()
bUnload = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
If bUnload Then
Else
Cancel = 1
End If
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
|