Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

Message box format

Hello all
On a very short learning curve with Delphi2005.net.
Can anyone please complete this bit of code to give me a yes, no, cancel button combination within my message box
messagebox.Show('test stuff','test caption');

Many thanks all
2 Solutions
Mohammed NasmanSoftware DeveloperCommented:
 MessageBox.Show( 'Test Stuff','Caption',MessageBoxButtons.YesNoCancel,MessageBoxIcon.Asterisk);
MessageDlg(text:string ,MessageDlgType,[Buttons],0);

MessageDlgType can be mtError, mtInformation, mtConfirmation

Buttons can be combined between the []'s (i.e. [mbYes,mbNo] will show the yes & no button on the message and [mbOK,mbCancel] will show the OK and Cancel buttons on the message, etc...)

I prefer this function cause it gives nicer message dlg, but it is just mine opinion

P.S. for if statements u can use idButton (.ie. if MessageDlg("Are you sure?",mtConfirmation,[mbYes,mbNo],0)=idYes then ....)

Hope this helps :)

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now