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!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Your Message", "Your Title");
- }
- }
- }
0 comments :
Post a Comment