Solved

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

Posted on 2011-09-13
4
804 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 500 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now