Salvador
Salvador

Reputation: 16482

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?

Upvotes: 7

Views: 2714

Answers (1)

RRUZ
RRUZ

Reputation: 136431

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

Upvotes: 14

Related Questions