|
-
July 22nd, 1999, 10:05 AM
#1
How I can remove ALT+F4 from a dialog box?..
Dear All,
How I can remove ALT+F4 key from a dialog box?.. I dont want to quit the dialog box when user press ALT+F4 key?.....
PL help me,....
Regards,
Kareem.
-
July 22nd, 1999, 11:43 AM
#2
Re: How I can remove ALT+F4 from a dialog box?..
you can trap the Form_QueryUnload event and check for the UnloadMode argument.
If you don't want the user to be able to end your program just set the Cancel argument to false.
-
July 22nd, 1999, 12:06 PM
#3
Re: How I can remove ALT+F4 from a dialog box?..
Hi,,
Thanks for your reply. But It does not work properly. After I added Form_QueryUnload() function and set Cancel to false, user can quit the dialog by pressing ALT + F4. You pl check .... let me know that ...
Regards,
Kareem.
-
July 23rd, 1999, 12:40 AM
#4
Re: How I can remove ALT+F4 from a dialog box?..
Set it to True or 1.
use Cancel = 1 . Cancel is defined as integer in QueryUnload and Unload events!!
But this code will also stop the unload from 'X' of the Form Control menu!!
private Sub Form_QueryUnload(Cancel as Integer, UnloadMode as Integer)
If UnloadMode = 0 then Cancel = 1
Debug.print UnloadMode
End Sub
-
July 23rd, 1999, 01:36 AM
#5
Re: How I can remove ALT+F4 from a dialog box?..
you need to set cancel to True!
private Sub Form_QueryUnload(Cancel as Integer, UnloadMode as Integer)
Cancel = true
End Sub
now you won't be able to close the form
-
September 18th, 2001, 09:49 AM
#6
Another bit of Knowledge from the Past
;-)
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
September 18th, 2001, 11:01 AM
#7
Re: How I can remove ALT+F4 from a dialog box?..
Make sure that the form KeyPreview is set to True then try the following code:
option Explicit
Dim CancelAltF4 as Boolean
private Sub Form_KeyDown(KeyCode as Integer, Shift as Integer)
CancelAltF4 = false
If KeyCode = vbKeyF4 then
If Shift And 4 = 4 then
MsgBox "ctrlv"
CancelAltF4 = true
End If
End If
End Sub
private Sub Form_QueryUnload(Cancel as Integer, UnloadMode as Integer)
If CancelAltF4 then
Cancel = true
CancelAltF4 = false
End If
End Sub
-
September 18th, 2001, 11:03 AM
#8
Take a smile....
Have a look at date this question was first posted....
;-)
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
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
|