Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How i can Skin the message box of my app when the vcl styles are activated?

I'm using the Application.MessageBox to show messages on my VCL application, but when the application had a vcl style applied the message window is shown with the windows style instead of the current vcl style.

Sample code

 Application.MessageBox('Hello World', 'Hello', MB_OK + MB_ICONINFORMATION);

Sample Image

enter image description here

How I can show a message box with the current vcl style?

like image 869
Salvador Avatar asked Feb 04 '12 21:02

Salvador


1 Answers

The Application.MessageBox function internally call the MessageBox WinAPi function, that window is not a form created by delphi so can't be skinned with the Vcl styles. Instead you must use one of the dialogs classes and functions declarated in the Vcl.Dialogs unit like the MessageDlg function.

MessageDlg('Hello World',  mtInformation, [mbOK], 0);

enter image description here

like image 149
RRUZ Avatar answered Sep 30 '22 13:09

RRUZ