Kamis, 20 Maret 2014

Ikon Kejadian Pada Perintah “MessageBox” dengan C#.NET 2010

ikonMessageBoxContoh sederhana menampilkan jenis-jenis ikon pada kotak pesan dengan menggunakan perintah MessageBox dengan Visual C#.NET 2010.

 

 

 

 

 

1. Ikon Asterisk

Image 1

   1: using System;
   2: using System.Collections.Generic;
   3: using System.ComponentModel;
   4: using System.Data;
   5: using System.Drawing;
   6: using System.Linq;
   7: using System.Text;
   8: using System.Windows.Forms;
   9:  
  10: namespace WindowsFormsApplication1
  11: {
  12:     public partial class Form1 : Form
  13:     {
  14:         public Form1()
  15:         {
  16:             InitializeComponent();
  17:         }
  18:  
  19:         private void button1_Click(object sender, EventArgs e)
  20:         {
  21:             MessageBox.Show("Halo, Dunia!", "Ikon Asterisk", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  22:         }
  23:     }
  24: }

2. Ikon Error


Image 2



   1: using System;
   2: using System.Collections.Generic;
   3: using System.ComponentModel;
   4: using System.Data;
   5: using System.Drawing;
   6: using System.Linq;
   7: using System.Text;
   8: using System.Windows.Forms;
   9:  
  10: namespace WindowsFormsApplication1
  11: {
  12:     public partial class Form1 : Form
  13:     {
  14:         public Form1()
  15:         {
  16:             InitializeComponent();
  17:         }
  18:  
  19:         private void button1_Click(object sender, EventArgs e)
  20:         {
  21:             MessageBox.Show("Halo, Dunia!", "Ikon Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  22:         }
  23:     }
  24: }

3. Ikon Exclamation


Image 3



   1: using System;
   2: using System.Collections.Generic;
   3: using System.ComponentModel;
   4: using System.Data;
   5: using System.Drawing;
   6: using System.Linq;
   7: using System.Text;
   8: using System.Windows.Forms;
   9:  
  10: namespace WindowsFormsApplication1
  11: {
  12:     public partial class Form1 : Form
  13:     {
  14:         public Form1()
  15:         {
  16:             InitializeComponent();
  17:         }
  18:  
  19:         private void button1_Click(object sender, EventArgs e)
  20:         {
  21:             MessageBox.Show("Halo, Dunia!", "Ikon Exclamation", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
  22:         }
  23:     }
  24: }

4. Ikon Hand


Image 4



   1: using System;
   2: using System.Collections.Generic;
   3: using System.ComponentModel;
   4: using System.Data;
   5: using System.Drawing;
   6: using System.Linq;
   7: using System.Text;
   8: using System.Windows.Forms;
   9:  
  10: namespace WindowsFormsApplication1
  11: {
  12:     public partial class Form1 : Form
  13:     {
  14:         public Form1()
  15:         {
  16:             InitializeComponent();
  17:         }
  18:  
  19:         private void button1_Click(object sender, EventArgs e)
  20:         {
  21:             MessageBox.Show("Halo, Dunia!", "Ikon Hand", MessageBoxButtons.OK, MessageBoxIcon.Hand);
  22:         }
  23:     }
  24: }

5. Ikon Information


Image 5



   1: using System;
   2: using System.Collections.Generic;
   3: using System.ComponentModel;
   4: using System.Data;
   5: using System.Drawing;
   6: using System.Linq;
   7: using System.Text;
   8: using System.Windows.Forms;
   9:  
  10: namespace WindowsFormsApplication1
  11: {
  12:     public partial class Form1 : Form
  13:     {
  14:         public Form1()
  15:         {
  16:             InitializeComponent();
  17:         }
  18:  
  19:         private void button1_Click(object sender, EventArgs e)
  20:         {
  21:             MessageBox.Show("Halo, Dunia!", "Ikon Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
  22:         }
  23:     }
  24: }

6. Ikon None


Image 6



   1: using System;
   2: using System.Collections.Generic;
   3: using System.ComponentModel;
   4: using System.Data;
   5: using System.Drawing;
   6: using System.Linq;
   7: using System.Text;
   8: using System.Windows.Forms;
   9:  
  10: namespace WindowsFormsApplication1
  11: {
  12:     public partial class Form1 : Form
  13:     {
  14:         public Form1()
  15:         {
  16:             InitializeComponent();
  17:         }
  18:  
  19:         private void button1_Click(object sender, EventArgs e)
  20:         {
  21:             MessageBox.Show("Halo, Dunia!", "Ikon None", MessageBoxButtons.OK, MessageBoxIcon.None);
  22:         }
  23:     }
  24: }

7. Ikon Question


Image 7



   1: using System;
   2: using System.Collections.Generic;
   3: using System.ComponentModel;
   4: using System.Data;
   5: using System.Drawing;
   6: using System.Linq;
   7: using System.Text;
   8: using System.Windows.Forms;
   9:  
  10: namespace WindowsFormsApplication1
  11: {
  12:     public partial class Form1 : Form
  13:     {
  14:         public Form1()
  15:         {
  16:             InitializeComponent();
  17:         }
  18:  
  19:         private void button1_Click(object sender, EventArgs e)
  20:         {
  21:             MessageBox.Show("Halo, Dunia!", "Ikon Question", MessageBoxButtons.OK, MessageBoxIcon.Question);
  22:         }
  23:     }
  24: }

8. Ikon Stop


Image 8



   1: using System;
   2: using System.Collections.Generic;
   3: using System.ComponentModel;
   4: using System.Data;
   5: using System.Drawing;
   6: using System.Linq;
   7: using System.Text;
   8: using System.Windows.Forms;
   9:  
  10: namespace WindowsFormsApplication1
  11: {
  12:     public partial class Form1 : Form
  13:     {
  14:         public Form1()
  15:         {
  16:             InitializeComponent();
  17:         }
  18:  
  19:         private void button1_Click(object sender, EventArgs e)
  20:         {
  21:             MessageBox.Show("Halo, Dunia!", "Ikon Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop);
  22:         }
  23:     }
  24: }

9. Ikon Warning


Image 9



   1: using System;
   2: using System.Collections.Generic;
   3: using System.ComponentModel;
   4: using System.Data;
   5: using System.Drawing;
   6: using System.Linq;
   7: using System.Text;
   8: using System.Windows.Forms;
   9:  
  10: namespace WindowsFormsApplication1
  11: {
  12:     public partial class Form1 : Form
  13:     {
  14:         public Form1()
  15:         {
  16:             InitializeComponent();
  17:         }
  18:  
  19:         private void button1_Click(object sender, EventArgs e)
  20:         {
  21:             MessageBox.Show("Halo, Dunia!", "Ikon Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  22:         }
  23:     }
  24: }

Label:

0 Komentar:

Posting Komentar

Berlangganan Posting Komentar [Atom]

<< Beranda