Using message boxes PDF Print E-mail

Displaying a message box is a common task in Windows programming. The simplest such program is probably similar to:

  1.  
  2. using System;
  3. using System.Windows.Forms;
  4. class MsgBoxSample : Form {
  5. public static void Main() {
  6. Application.Run( new MsgBoxSample() );
  7. }
  8. MsgBoxSample() {
  9. MessageBox.Show( "Thank you for using this tutorial" );
  10. }
  11. }
 

We use a constructor and we call the Show static method of the MessageBox class. We pass the string to be displayed as argument and there are other versions of this method which accept the type of icon to display etc.

(Once again the documentation provides the details).




Bookmark it...
Digg!Reddit!Del.icio.us!Google!Facebook!Slashdot!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!
 
< Prev   Next >
Joomla Template by Joomlashack
Joomla Templates by JoomlaShack Joomla Templates by Compass Design