Topic: MessageBox

Hello

Anybody can give me an example of MessageBox on how to apply in MVD.

Thanks!

Re: MessageBox

Hello manixs2013

Beginning of a clue :

MessageBox can modify caption of a message. By example, if  Windows OS is into french, then buttons will be into french.

Example:

if IDYES = MessageBox('Message', 'Caption', MB_YESNO+MB_ICONINFORMATION) then ShowMessage('Yes');

Boutons:

MB_OK
MB_OKCANCEL
MB_ABORTRETRYIGNORE
MB_YESNOCANCEL
MB_YESNO
MB_RETRYCANCEL

Résultats :

IDOK
IDCANCEL
IDABORT
IDRETRY
IDIGNORE
IDYES
IDNO

Icônes :

MB_ICONWARNING
MB_ICONINFORMATION
MB_ICONASTERISK
MB_ICONQUESTION
MB_ICONSTOP
MB_ICONERROR

JB

Re: MessageBox

Can I have a sample MVD project.

Thanks!

Re: MessageBox

An example :

Let's say you place a button on a form. This button says : 'Exit? ':
You could display a message asking for confirmation to exit.

Procedure TForm1.ButtonClick(Sender :TObject);
Var  rep : word;
Begin
     reponse := MessageDLG ( ’VDo you want exit ?’ , mtConfirmation, mbOkCancel, 0) ;
    if reponse = mrOK then close ;
end;

JB

Re: MessageBox

Here is a sample project using MessageBox. It's not very sophisticated, but it demonstrates the various options.

Post's attachments

Attachment icon MessageBox.zip 580.17 kb, 494 downloads since 2017-06-08 

Re: MessageBox

Thanks to All!