Friday 17 June 2016




How to create MessageBox Show  in C#.NET  








Double click on this button . will be create cs page and write below 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.Threading.Tasks;
using System.Windows.Forms;

namespace PricticeOne
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)

            MyClass.ShowMessage(20);
        }



After create a class page and write below this code


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PricticeOne
{
    class MyClass

    {
        enum Names:byte
        {
            Adm = 1,
            jon = 2,
            miki=3


        }
        string Name;
        public MyClass(string name)
        {
            Name = name;
        }
         string name()
        {
            return Name;
        }

         Names myname = Names.Adm;
        public static void ShowMessage(string message)
         {
             System.Windows.Forms.MessageBox.Show(message);
         }
        public static void ShowMessage(int message)
        {
            System.Windows.Forms.MessageBox.Show(message.ToString());
        }
    }
}









How to Create FileDialog in C#.NET


At first take a form . Than take  a button in toolber . Last step double click on the button create a new page , write this code on this page . done  . Run your page .