ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

20-Advanced MessageBox

In this section, you will learn here how to display a message in the messagebox and make it more advance by changing the icon and the buttons displayed.

 

This is the syntax of the advance messagebox:

  1. if  MessageBox.Show([message],[title], [actions] ,[icon]) = [dialog result]  then
  2.  
  3. statements..
  4.  
  5. else
  6.  
  7. statements..
  8.  
  9. end if
  10.  
  11.  

example

  1. Public Class Form1
  2.  
  3. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4. If MessageBox.Show("Hello World", "hello world", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
  5. MessageBox.Show("clicked yes")
  6. Else
  7. MessageBox.Show("clicked no")
  8. End If
  9. End Sub
  10.  
  11. End Class
Facebook Comments

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!