Lazarus

Programming => LCL => Topic started by: dahaiou on July 31, 2012, 08:53:14 am

Title: How to center a pop-up confirmation dialogue on screen in current monitor?
Post by: dahaiou on July 31, 2012, 08:53:14 am
Is there an established technique to make a dialogue pop up where I want it?

First of all, I'd like it to appear in the same monitor where the main form is currently located. It's really easy to miss, and frustrating when a confirmation dialogue pops up on screen in a different monitor. (As an aside - this happens a lot for apps in general, even with some big commercial apps).

And I'd like it centered on screen in that monitor, rather than any random location away at the edge somewhere as is happening now, with maybe 90 percent of the dialogue off-screen.

How can I control these things? An example would be great.
Title: Re: How to center a pop-up confirmation dialogue on screen in current monitor?
Post by: User137 on July 31, 2012, 09:03:45 am
You should look into TForm.Position property. There are different centering options available.
Title: Re: How to center a pop-up confirmation dialogue on screen in current monitor?
Post by: Shebuka on July 31, 2012, 10:28:47 am
If you are talking about MessageDlg you can't control them, they are system based.
If you are talking about CreateMessageDialog then you can control the resulting TForm as you control a normal TForm, set size, move on the screen, add or remove buttons, change captions ecc...
TinyPortal © 2005-2018