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?
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With