Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

coloring the message dialog..

Posted on 2000-04-21
6
Medium Priority
?
171 Views
Last Modified: 2010-04-04
Is there a way to display a message dialog with customised colours.?
I am using the "messagedlg()" command.
0
Comment
Question by:tanm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 2

Expert Comment

by:rene100
ID: 2737884
Hi

I think this isn't possible, because MessageDlg() uses a windows-api-function to display the messagebox....
The colors of the msgbox are determined by the system settings, so you could change these settings..


regards
rene
0
 

Accepted Solution

by:
d32coder earned 40 total points
ID: 2738182
No, but you can create a new Form that emulates the messagebox.  That way you can customize it completely.

This is not considered good code but it will give you more options.
0
 

Expert Comment

by:PascalCP
ID: 2738306
Hi,

It is not possible without creating your own form ! Because windows is calling an API .
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:SuperSy
ID: 2739213
Not necessarily ... I think you can override the CreateMessageDialog() for that ...

Let me check.
0
 

Expert Comment

by:SuperSy
ID: 2739235
Ok ... my answer is "Yes", according to the question.  The question simply says "Is there a way...?" and yes, there is.  Not with MessageDlg(), but there sure is.  And except for the color, the dialog looks exactly like the one with MessageDlg().

If you are willing to change all the MessageDlg() commands in your app to, say, MyMessageDlg(), you can change the background of your boxes to a different color.  

Of course, you have to write your own MyMessageDlg like this:

function MyMessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer;
begin
  with CreateMessageDialog(Msg, DlgType, Buttons) do
  begin
    try // ..finally
      HelpContext := HelpCtx;
      // Let's try red
      Color := $000000FF;
      Result := ShowModal;
    finally
      free;
    end; // try
  end;
end;

If you try, you can see that only the background is red; the buttons are still grey.  

Now that I think of it, what I did is exactly what d32coder said... I have created a new Form that emulates the messagebox, with a coloring twist.  I just created the form using code supplied by Delphi.

I personally will consider this good enough code.  ^_^

By the way, if you want to change the button colors as well, do post a comment here.  
0
 

Author Comment

by:tanm
ID: 2739515
Brilliant! That's is precisely what i need..
Thanks very much..
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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 this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

604 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