[AccessD] Disable Control Box with Form Maximized?

Greg Smith GregSmith at starband.net
Thu Sep 1 12:51:31 CDT 2005


Charlotte:

Good point.  I just demonstrated (for myself) exactly what you were
talking about...getting trapped in a window with no way out.  Except my
only way out was to kill the program with the task manager...I didn't
leave myself an out when I was testing...sigh...well, I did, but I
couldn't get to it to release the form...so I was stuck.  We'll just stop
going down THIS road.  I only have to run into the ditch a couple of times
before I realize it's the wrong way... ;)

Thanks again, Doris and Charlotte!

Greg


> It can, I believe, be done with API calls, but it is definitely
> draconian.  As long as you use the UnLoad event to make sure everything
> runs properly before the form closes, does it really matter?  Windows
> doesn't want users getting trapped in a window with no way out, so it
> graciously shows a close button when you maximize a form.  If your code
> breaks somehow so that your command button doesn't work (yes, I've had
> that happen), the window close button would be the only way short of Alt
> F4 to close the window.
>
> If you still want to try it, search the archives.  I'm pretty sure it's
> been explored here before.
>
> Charlotte Foust
>
>
> -----Original Message-----
> From: Greg Smith [mailto:GregSmith at starband.net]
> Sent: Thursday, September 01, 2005 9:47 AM
> To: accessd at databaseadvisors.com
> Subject: RE: [AccessD] Disable Control Box with Form Maximized?
>
>
> Doris:
>
> Thanks for responding!  I didn't realize the Form_Unload event could be
> cancelled.  That does work and I can check it there.
>
> However, I'd really like to just make the controlbox vanish so they
> don't even have the choice.  But, if I set the Control Box property to
> No for the form on the Properties Sheet, it only applies when the form
> is NOT maximized.  If the form is maximized, the silly thing reappears
> in the upper right hand corner.
>
> Or is there another way to set that property?
>
> Greg
>
>> You have a couple of options...
>>
>> 1) Set the Control Box property of the form to False so the exit
>> button doesn't show.  The only problem with this approach is that you
>> lose the min/max buttons.
>>
>> 2) Call the code behind your Exit button from the Form_Unload event.
>> This code runs when the form is closed and before the form is removed
>> from memory.  Unlike the Form Close Event, the Form Unload Event can
>> be cancelled.
>>
>> Order of events when a form closes (Acces97 and up)...
>>
>> BeforeUpdate -> Unload -> Deactivate -> Close
>>
>> Doris Manning
>> mikedorism at verizon.net
>>






More information about the AccessD mailing list