• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

How to disable..?

Hello,

I used a fixedDialog as a form's borderstyle. The min. and max. buttons is disappear already, but I don't want the close button that appear in the top right hand corner, also the close option appear in the system menu.
How can I disable them ? such that the user cannot close the dailog box by pressing the close button or the close option in the menu.
Please help!

Regards,

Raymond
0
rng
Asked:
rng
1 Solution
 
Brendt HessSenior DBACommented:
See:

http://www.mvps.org/vbnet/code/system/killclose.htm

To show you how to kill the close button and menu option
0
 
AzraSoundCommented:
set controlbox property to false
0
 
RuchiCommented:
Try this.

Option Explicit

Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then Cancel = 1
End Sub
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
dreamvbCommented:
Try this it will stop the user form closeing the form

Private Sub Form_Unload(Cancel As Integer)
 Cancel = 1
 
End Sub

also put is into your menu.
0
 
vrkpemmarajuCommented:
The good thing u can do is to make the control box false and u can even embose another control on the top right of the form and u can operate with that also if u don't want to use the system close option. And, if u make false the control box the system close option also will not appear. u try this if not give me ur descriptive question so that i can answer u for the specific problem
0
 
AzraSoundCommented:
<sigh>
0
 
RuchiCommented:
Vbdream,
It is not good idea to mark your solution as answer. You should mark it as comments. If Rng will find your solution the best solution for this situation, he/she will ask you to mark it as answer, or he/she can accept your solution as answer.
0
 
RuchiCommented:
Oops.. I meant Dreamvb. I am sorry!
0
 
wsh2Commented:
DreamVB Writes:

Private Sub Form_Unload(Cancel As Integer)
 Cancel = 1
 
End Sub

If you need to close the program just press Alt-Ctrl-Delete a couple of times, right?.. 'cause that baby is NEVER going to unload on its own.. <smile>.

Checkout Ruchi's Query_Unload and UnLoadMode test above.

0
 
rngAuthor Commented:
Thanx everyone.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now