Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1061
  • Last Modified:

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

Please provide sample code (D7) of custom MessageDlg/ShowMessage that will center it on form it called from.
Thanks.
0
3axap
Asked:
3axap
  • 2
  • 2
1 Solution
 
epasquierCommented:
0
 
3axapAuthor Commented:
I did try that before posting my request.  poOwnerFormCenter doesn't work if I move form.
0
 
epasquierCommented:
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
 
3axapAuthor Commented:
That's the solution.
Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now