imarshad
asked on
How to disable the Close Button at Runtime.......??
Hi all,
I want to disable the Close button of my form during some function call in my code......
Something like this.....
call DisableCloseButton
call MyFunction
call EnableCloseButton
I have tried to use the enable property but it freezes the whole form which is not desireable.........
Imran Arshad
I want to disable the Close button of my form during some function call in my code......
Something like this.....
call DisableCloseButton
call MyFunction
call EnableCloseButton
I have tried to use the enable property but it freezes the whole form which is not desireable.........
Imran Arshad
Last example is to enable. To disable
yourform.Controlbox=false
yourform.Controlbox=false
Hi,
Here is a code sample from MS which allows you to disable the close button during runtime:
How To Disable the Close Option on Control Menu of a VB Form
http://support.microsoft.com/support/kb/articles/Q184/6/86.asp
Hope it helps!
Here is a code sample from MS which allows you to disable the close button during runtime:
How To Disable the Close Option on Control Menu of a VB Form
http://support.microsoft.com/support/kb/articles/Q184/6/86.asp
Hope it helps!
ASKER
Compilation Error.....
Function or interface marked as restricted, or the function uses an automation type not supported in VB....
Function or interface marked as restricted, or the function uses an automation type not supported in VB....
You cannot set the ControlBox property of a form in code. This is only available in design time.
ASKER
Erick37,
What you have supplied is exactly what I want........Isn't there a simple way of doing it ? If none then I will give the points to you...........I am trying to write the DisableCloseButton and EnableCloseButton from the code you have suggested.....
I will ideally like to have these functions in a Module.......Can you help me in this regard ? My main form is Form1......
Imran Arshad
What you have supplied is exactly what I want........Isn't there a simple way of doing it ? If none then I will give the points to you...........I am trying to write the DisableCloseButton and EnableCloseButton from the code you have suggested.....
I will ideally like to have these functions in a Module.......Can you help me in this regard ? My main form is Form1......
Imran Arshad
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the help......
Imran Arshad
Imran Arshad
yourform.Controlbox=true