A Revolution
From the Norm,
Towards Greatness
Home » » CSharp (C#): How to show a Messagebox & Title (Hello World)

CSharp (C#): How to show a Messagebox & Title (Hello World)

Written By Unknown on Monday, May 30, 2016 | 5:27 AM

CSharp (C#): How to show a Messagebox with a Title 


Hello programmers, welcome to a very very short tutorial on C#! Today we are going to go over on how to simply make a messagebox show when a button is clicked or when you use it in another event.

To get started in this tutorial, you are going to need the following items.

  • Button1
  • that is all, if you wanted to you can just make the message load when the form starts or something like that. 
MessageBox.Show("Your Message); That is the main part you need to get this code working, bellow is more in details plus also on how you can add your own tittle to it.
You can watch my YouTube below for a visual tutorial, or simply right below the video you can grab the source code and get started!



  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. namespace WindowsFormsApplication1
  10. {
  11.     public partial class Form1 : Form
  12.     {
  13.         public Form1()
  14.         {
  15.             InitializeComponent();
  16.         }
  17.         private void button1_Click(object sender, EventArgs e)
  18.         {
  19.             MessageBox.Show("Your Message""Your Title");
  20.         }
  21.     }
  22. }




SHARE

About Unknown

0 comments :

Post a Comment