Jump to content

Keep screenmask active after messagedialog or showmessage in a event


albertovesx

Recommended Posts

Sometime I have the following situation:

 

I set the screenmask to btnTest, but after the user answer the messagedlg the screen mask desapears. I want that the screen mask remains after the messagedlg. How can I achieve this?

 

procedure TfrmSomeForm.btnTestClick(Sender: TObject);

begin

  

  Lines of code

 

   messagedlg() // Ask something to the user

 

   A lot of lines of code after messagedlg executing without screen mask

 

end;

 

Thanks

 

  • Upvote 1
Link to comment
Share on other sites

  • 1 year later...

Hello, I need a solution too for the same problem.

In the following code:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  try
    ShowMask( 'blocking mask...');
    unisession.synchronize;

    sleep(1000);
    showmessage('step 1');
 
    sleep(1000);
    showmessage('step 2');

    sleep(1000);
    showmessage('step 3');
  finally
    HideMask;
  end;
end;

the mask disappears between step 1 and step 2.

The same behaviour applies to MessageDlg and ShowModal...

Is there a solution ? Blocking masks should remain until they are explicitely hidden with command HideMask,

this is the reason for putting them in a try.. finally block....


 

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...
  • 2 years later...

I have a similar problem.

Instead of display a message (after my mask is enabled), i display a form for the user to pick an option. Then when the form is closed, the mask is GONE.

How do i keep the mask active once the form is loaded and then closed?

Thanks

DAvie

Link to comment
Share on other sites

11 hours ago, vbdavie said:

I have a similar problem.

Instead of display a message (after my mask is enabled), i display a form for the user to pick an option. Then when the form is closed, the mask is GONE.

How do i keep the mask active once the form is loaded and then closed?

Hello,

I didn't quite understand your case.

Link to comment
Share on other sites

okay.

1. the user clicks a buttons and i enabled the mask

2. the screen goes gray with a mask (good)

3. I do a bunch of logic

4. I do a bunch more logic (a little time consuming maybe 3 seconds)

5. I turn off the mask and the screen returns to normal (good)

 

If I open a form in step 3 so that the user can pick some options, then when the form closes, the screen's mask is turned off. That means while step 4 is executing (maybe 3 seconds) the mask is off and the screen looks normal and the user THINKS he can click and do things when in fact step 4 is not done yet.

 

Thanks

DAvie

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...