Reputation: 16482
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
How I can show a message box with the current vcl style?
Upvotes: 7
Views: 2714
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);
Upvotes: 14