Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MessageDlg/ShowMessage that will center on form it called from.

Posted on 2011-09-13
4
Medium Priority
?
975 Views
Last Modified: 2012-05-12
Please provide sample code (D7) of custom MessageDlg/ShowMessage that will center it on form it called from.
Thanks.
0
Comment
Question by:3axap
  • 2
  • 2
4 Comments
 
LVL 25

Expert Comment

by:epasquier
ID: 36530862
0
 

Author Comment

by:3axap
ID: 36530966
I did try that before posting my request.  poOwnerFormCenter doesn't work if I move form.
0
 
LVL 25

Accepted Solution

by:
epasquier earned 2000 total points
ID: 36531026
ah, then do it the *hard* way
with CreateMessageDialog(Msg, DlgType, Buttons) do
    try
      Position := poDesigned;
      Left:=Self.Left+(Self.Width-Width) Div 2;
      Top:=Self.Top+(Self.Height-Height) Div 2;
      Result := ShowModal
    finally
      Free
    end

Open in new window

0
 

Author Closing Comment

by:3axap
ID: 36531300
That's the solution.
Thanks.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question