Lock App Window

Moderator: Rathinagiri

Post Reply
melliott42
Posts: 119
Joined: Wed Feb 18, 2009 2:14 pm

Lock App Window

Post by melliott42 » Fri May 06, 2016 4:25 pm

Hello,

In some long running processes how can I lock the main window so no controls can be clicked on until my process is done?

I could individually disable all the controls but some controls I am using do not have a Enabled property. In Visual Basic I'd simply lock the window then unlock it until the freeze was over. I may have needed an API function to do this back in VB.

Does a Progress Bar control stop users from clicking on all other controls on a window?

What method do you use when doing these type operations where you want to stop anyone from being able to click on a control?


Thanks,

Michael

User avatar
mol
Posts: 3227
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 224 times
Been thanked: 127 times
Contact:

Post by mol » Fri May 06, 2016 4:55 pm

Create simple modal window wirh label "Please wait until process ends..." with no title bar.
After finishing your function, release this window.

melliott42
Posts: 119
Joined: Wed Feb 18, 2009 2:14 pm

Post by melliott42 » Fri May 06, 2016 5:37 pm

I found the WAIT WINDOW example that that works perfect.

Thanks!

User avatar
srvet_claudio
Posts: 2044
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 35 times
Been thanked: 146 times
Contact:

Post by srvet_claudio » Fri May 06, 2016 6:48 pm

See:

Code: Select all

<FormName>.Enabled := .F.
	...
<FormName>.Enabled := .T.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

EduardoLuis
Posts: 653
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina
Has thanked: 1 time
Been thanked: 61 times

Post by EduardoLuis » Fri May 06, 2016 8:25 pm

Hi Melliot:

I use another option: i create a Window MODAL where i put - as your example - a progress bar control.-
Modal window must be defined with this properties:

NOSIZE ;
NOSYSMENU ;
NOCAPTION ;

This way you en user only see progress bar and wait till it ends meanwhile he can't do anythings.-

When progressbar or any process end, the window MODAL must be closed and end user returns to controll the app.-
Hopping this helps you.
With regards.
Eduardo

User avatar
mol
Posts: 3227
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 224 times
Been thanked: 127 times
Contact:

Post by mol » Fri May 06, 2016 9:05 pm

That is exactly what I mean :-D

melliott42
Posts: 119
Joined: Wed Feb 18, 2009 2:14 pm

Post by melliott42 » Mon May 09, 2016 11:53 am

The Modal Window as you guys described is the best method I think.

I implemented the WAIT WINDOW because it was the quickest route but will change it accordingly. The modal window, as you guys described, will look more professional.

The WAIT WINDOW is pretty cool. Just wish it had more options.

Thanks!

Post Reply