Desktop application controls like Textbox, label, Button and Combobox

Introduction of Windows application controls like “Textbox”, “label”, “Button” and Combobox
1. Firs we sill see Textbox control and its property…
select textbox from toolbox : either drag to form or click on the control and then click to the area at form where you want to put the control…
Now we will set all the properties of the Textbox control…
So we have some essential property for textbox:
1. name : will be used for coding to address the controll(txtName in the example)
2. Text: To set or get the text input of textbox
3. Multiline: to change the textbox to multiline textbox(True or false)
4. Password Char: to set the password field (* in the example)

Now Lable:
Label is used for labeling and ofetnly used for showing some information or message.
Imp Property: name, text , font etc

It is used to select one of some option like Gender(Male or female) etc..
Property: Lets see some imp property of dropdownlist:
1: Name
2. Items: Collection of items(options)
3. Dropdownstyle: Dropdownlist(readonly) and dropdown(typable)
4. Text

Now most important control Button
Property: Name and text
Now we will see some coding to use these controls.
Double click on the Button..
It will open the code sheet…

Lets see the result:
run the project: Press F5

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 Basic_Controls
public partial class Form1 : Form
public Form1()

private void btnShowMessage_Click(object sender, EventArgs e)
MessageBox.Show(“My name is: ” + txtName.Text + ” and My Gender is: ” + cmbGender.SelectedItem.ToString());


One Reply to “Desktop application controls like Textbox, label, Button and Combobox”

Leave a Reply

Your email address will not be published. Required fields are marked *