Click here to Skip to main content
16,020,537 members
Articles / Programming Languages / C#
Article

DialogBoxes

Rate me:
Please Sign up or sign in to vote.
2.11/5 (8 votes)
31 Oct 2006 32.5K   355   12   5
Frequently used Dialog Boxes

Introduction

This article is a demonstration of the usage of three types of most frequently used dialog boxes. The first One is the Input Box. This One is very usefull in C#.net because, I think there is no sunch a thing in it. Its is as same as the one VB. Its has four overloading methods The Second one is the Combo Input Box. Which is slightly modified from The Input Box. Here we populate the Combo Box by passing a string array and select or enter a new value. The Third is the Change Password Dialog Box. Here we pass the current password and validate it with the new password and confirm password and get the new password on OK.

The Code

First Add the Dialog Boxs.dll file into refrence.
using DialogBoxs;
Input Text Box
TextInputBox ObjTextInputBox= new TextInputBox();
            if( ObjTextInputBox.Show("Enter the Value",this.Text) == DialogResult.OK)
                MessageBox.Show("The Entered Value : "+ObjTextInputBox.Text);
Input Combo Box
ComboInputBox ObjComboBox = new ComboInputBox();
            string[] Names=new string[10];
            Names[0]="India";
            Names[1]="USA";
            Names[2]="UK";
            Names[3]="RUSSIA";
            Names[4]="Bulgaria";
            Names[5]="Singapore";
            Names[6]="Malayasia";
            Names[7]="Japan";
            Names[8]="Thailand";
            if(ObjComboBox.Show("Select or Enter the Country",this.Text,Names) == DialogResult.OK)
                MessageBox.Show("The Selected or Entered Country : "+ObjComboBox.Text);
Change Password
ChangePasswordDialogBox ObjChangePasswordDialogBox= new ChangePasswordDialogBox();
            if (ObjChangePasswordDialogBox.Show("Enter the Details to Change Password",this.Text,"123456")==DialogResult.OK)
                MessageBox.Show("New Password : " +ObjChangePasswordDialogBox.NewPassword);
Sample image

Summary

This is a simple project.The Main Intension of this project is make C#.net as easy as Vb.net, as the early contains a Input Box with less features. Please do give any ideas or any requirments which are frequently need in the projects.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
India India
Hi,
Am Chandru. I'm a Software developer. Am concentrating Only on Microsoft Technologies more than others. Don't ask me why..! I usually write codes a lot.. I do them because I Like them. Am working in a software firm in India. i've done a Post Graduation in Computers.

Comments and Discussions

 
GeneralHINTS Pin
gmt521-Nov-06 1:33
gmt521-Nov-06 1:33 
GeneralRe: HINTS Pin
ChandraSekar Maheswaran1-Nov-06 1:52
ChandraSekar Maheswaran1-Nov-06 1:52 
GeneralRe: HINTS Pin
Dominik Reichl1-Nov-06 2:07
Dominik Reichl1-Nov-06 2:07 
GeneralRe: HINTS Pin
Xaroth1-Nov-06 3:41
Xaroth1-Nov-06 3:41 
You can always make your own forms and use the ShowDialog() method of it... also means you can make your custom-made dialog boxes 'fit' in your project (So you don't get a dull Dialog in a slick looking program..)
GeneralRe: HINTS Pin
ChandraSekar Maheswaran1-Nov-06 2:07
ChandraSekar Maheswaran1-Nov-06 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.