Skip to main content

CsharpForBeginers 01 - Showing MessageBoxes

Hi guyz
This post about some of basic things in  MessageBox .
In this Post I am talking about 

  • MessageBox.Show()
  • MessageBoxButtons
  • MessageBoxIcon
  • MessageBoxDefaultButton
  • MessageBoxOptions




Initially you have to create new project and create simple User interface like below.
in this project I am using
·         Visual studio 2010 


MessageBox.Show()

  • 1.       Double click on the button and you can see some codes like this



  •        Add following codes in to the  private void button1_Click (object sender, EventArgs

Code:
MessageBox.Show("Hellow C#");


Write whatever you want to display within the inverted commas. I want to display here as
 Hellow C#
So final code should be like this


Code:
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 CsharpForBeginers
{
    public partial class ShowingMessageBoxes : Form
    {
        public ShowingMessageBoxes()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Hellow C#");
        }
    }
}

  • 1.       Then Run the Program and click the button you can see output like this












Comments

Popular posts from this blog

Imagine Cup 2014

Hi guys .. Get ready for imagine cup 2014 In NewZealand .In the next few days imagine cup 2013 finals will happen in Russia. So It is time to wear your thinking hat.You have one year to develop your marvelous ideas.  The Microsoft Imagine Cup is the world’s most prestigious student technology competition, bringing together student innovators from all over the world. If you have a great idea for a new app, bring it to life through Imagine Cup. Over the past 10 years, more than 1.65 million students from 190 countries have participated in the Imagine Cup. 

Visual Studio 2013 New Editor Features

In Visual Studio 2013, we have introduced new features that boost productivity and save time when working inside the Editor. Some of these are new features and some are the most popular extensions from  Productivity Power Tools . These features are a result of the feedback you gave us through  User Voice  requests, forum posts and Connect bugs. The MVP community also helped us pick some of these experiences. Our primary focus for the Editor in this version is to keep the developer in context as much as possible. This blog post describes capabilities that bring information to your fingertips and allow you to do as much as possible without leaving your place in code.

C# Character Escape Sequences

Character combinations consisting of a backslash ( \ ) followed by a letter or by a combination of digits are called "escape sequences." To represent a newline character, single quotation mark, or certain other characters in a character constant, you must use escape sequences. An escape sequence is regarded as a single character and is therefore valid as a character constant.