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)
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:
2. Items: Collection of items(options)
3. Dropdownstyle: Dropdownlist(readonly) and dropdown(typable)
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
public partial class Form1 : Form
private void btnShowMessage_Click(object sender, EventArgs e)
MessageBox.Show(“My name is: ” + txtName.Text + ” and My Gender is: ” + cmbGender.SelectedItem.ToString());
How useful was this post?
Click on a star to rate it!
Average rating / 5. Vote count:
We are sorry that this post was not useful for you!
Let us improve this post!
Thanks for your feedback!