SlideShare a Scribd company logo
1 of 26
Session 1
Trình bày : Võ Ngọc Đạt
Email : vongocdatit@gmail.com
Điện thoại : 0934.969.680
Slide 1 of 3809/20/13
Windows Forms and Basic Controls
Slide 2 of 2609/20/13
This module provides an overview of Windows Forms and the basic controls used to
create graphical user interfaces.
Module Introduction
A Windows Form is a window used to hold various controls.
These controls are graphical objects that facilitate user interaction to accept data or to
display information.
Slide 3 of 3809/20/13
Windows Forms
Windows Forms allows the developer to create user interfaces using various built-in
components.
The applications created using Windows Forms are executed on the local machine. The
form can access the resources of the local machine such as memory, printer, folders, and
files.
The role of Windows Forms include:
+ Holding controls
+ Handling user input
+ Displaying information
+ Connecting to database, which might exists
on another machine
Slide 4 of 3809/20/13
Windows Forms in .NET Framework
Slide 5 of 3809/20/13
"Form" Class
- The basic unit of an application is a form.
- A form is a container that holds and manages controls and is
used to create GUI based Windows applications.
- A Windows Form application will have at least one form
(window)
- Create a form in an application by creating an object of
the Form class
System.Windows. Form namespace.
Slide 7 of 3809/20/13
Property Description
ForeColor Specifies or retrieves the foreground color.
Location Specifies or retrieves the co-ordinates of the upper left corner of the form.
Modal Specifies or retrieves a value indicating whether the form is shown modally. This means if the user tries to
activate another window or form, the user cannot do so without closing the current modal form.
WindowState Specifies or retrieves a value indicating whether a form is minimized, maximized, or is in the normal state.
Method Description
Activate Activates a form and gives it focus.
Focus Puts the focus on a control.
Event Description
Activated Occurs when the form is activated in code or by the user.
Click Occurs when a control in clicked.
Deactivate Occurs when the focus on the form is taken away in code or by the user.
FormClosed Occurs after the form is closed.
GotFocus Occurs when the focus is put on a control of the form.
Resize Occurs when a control on the form is resized.
Validated Occurs when validation is completed by a control. For example, the event is raised after validating the login
details in the TextBox control.
Slide 8 of 3809/20/13
Slide 9 of 3809/20/13
Lifecycle of Windows Forms
Slide 10 of 3809/20/13
Types of Controls
Microsoft Visual Studio provides different types of controls for Windows Forms
programming.
Slide 11 of 3809/20/13
Types
A control is associated with its respective built-in class defined in the System.Windows.Forms
namespace.
For example, the Label control is associated with the Label class.
Each control class consists of various properties, methods, and events
Slide 12 of 3809/20/13
"Control" Class
The Control class is the base class of all the controls
The class is defined in System.Windows.Forms namespace and defines various properties,
methods, and events.
Slide 13 of 3809/20/13
Slide 14 of 3809/20/13
Property Description
Controls Retneves a collection of controls contained within the control.
Name Specifies or retrieves the name of a control.
Parent Specifies or retrieves the parent container of the control.
Method Description
Focus Sets input focus to the control.
Hide Hides the control from the user.
Select Activates a control.
Show Displays the control.
Event Description
Click Occurs when a control is clicked.
ControlAdded Occurs when a new control is added to the Control .
Doubleclick Occurs when the control is double-clicked.
GotFocus Occurs when the focus is on the control.
Leave Occurs when the input focus leaves the control.
LostFocus Occurs when the control loses focus.
Move Occurs when the user moves the control.
TextChanged Occurs when the value of the Text property changes.
Slide 15 of 3809/20/13
"Label" Control
- The Label control is a control that is used to show detailed information, which cannot be
modified by the user.
- The most common purpose of the Label control is to provide captions to the controls
Slide 16 of 3809/20/13
"TextBox" Controls
- The TextBox control takes the required information from the user, which can be modified.
For example, you can create a TextBox control to accept the name of the student.
Property Description
CharacterCasing Specifies whether the characters should be converted to uppercase or lowercase.
MaxLength Specifies or retrieves the maximum number of characters that the user can enter in
the control.
MultiLine Specifies or retrieves a value indicating whether the user can enter multi-line text.
Name Specifies or retrieves the name of the control.
PasswordChar Specifies or retrieves the special character used to mask characters of a password.
Readonly Specifies or retrieves a value whether the text in the control is editable.
Text Specifies or retrieves the text on the control.
Slide 17 of 3809/20/13
Method Description
AppendText Adds text to the existing text of the control.
Clear Removes text from the control.
Copy Copies the selected text in the control to the Clipboard.
Focus Sets the input focus on the control to enter text.
Paste Replaces the selected text in the control with the text copied to the Clipboard.
Event Description
KeyPress Occurs when the user has finished pressing a key.
Leave Occurs when the control is no longer the active control of the form.
TextChanged Occurs when the value of the Text property changes.
Slide 18 of 3809/20/13
Property Description
Mask Specifies or retrieves the characters to be used as a mask.
MaskCompleted Retrieves a value indicating whether the user has entered all the required
characters into the input mask.
Name Specifies or retrieves the name of the control.
PromptChar Specifies or retrieves the character to be used for prompting the user if the user
has missed some input.
Text Specifies or retrieves the text on the control.
"MaskedTextBox" Controls
- The MaskedTextBox control is a new control used to validate user input.
Slide 19 of 3809/20/13
"Button" Control
The Button control provides the easiest way to allow the user to interact with an application.
The user can click the button to perform the required action.
Slide 20 of 3809/20/13
Property Description
DialogResult Specifies or retrieves a value which is sent to the parent form when a button is
clicked.
Enabled Specifies or retrieves a value indicating whether the control can be accessed by the
user.
FlatStyle Specifies or retrieves the flat style of the control, which can be Flat, standard, Popup,
or System.
Image Specifies or retrieves the image on the control.
Name Specifies or retrieves the name of the control.
Text Specifies or retrieves the text on the control.
Method Description
Focus Sets the focus on the control.
PerformClick Triggers a Click event for a button.
Event Description
Click Occurs when the control is clicked.
Doubleclick Occurs when the control is double-clicked.
MouseDoubleClick Occurs when the control is double-clicked using the mouse.
Slide 21 of 3809/20/13
"ListBox" and "ComboBox" Controls
- The ListBox control is a control used to select a single value or multiple values from the given
list of values.
- The ComboBox control is similar to the ListBox control, but it allows you to select only one
value at a time.
Slide 22 of 3809/20/13
Property Description
Items Retrieves the items of the control.
SelectionMode Specifies or retrieves the way in which items are selected in the control, which can be:
+ None: For not selecting any item
+ One: For single selection
+ MultiSimple: For multiple selections
+ MultiExtended: For multiple selections using the Shift + Mouse click, Shift+ Arrow
keys, or Ctrl+ Mouse click.
Selectedlndex Specifies or retrieves the zero-based index number of the selected item in the control.
Text Specifies or retrieves the text of the selected item in the control.
Method Description
ClearSelected Deselects all the selected items in the control.
GetltemText Retrieves the text of the given item.
GetSelected Returns true if the specified item is selected and returns false if the specified item is not
selected.
SetSelected Selects or removes the selection for a specified item.
Event Description
SelectedlndexChanged Occurs when the value of the Selectedlndex property is modified.
SelectedValueChanged Occurs when the value of the SelectedValue property is modified.
"ListBox" Controls
Slide 23 of 3809/20/13
Slide 24 of 3809/20/13
"ComboBox" Controls
Property Description
DropDownStyle Specifies or retrieves a value indicating the style of the control. The appearance of the
control can be changed to Simple, DropDown, and DropDownList styles.
Items Retrieves the object containing the items of the control.
MaxDropDownItems Specifies or retrieves the maximum number of items to be displayed in the control.
Selectedltem Specifies or retrieves the selected item in the control.
Selectedlndex Specifies or retrieves the zero-based index number of the selected item in the control.
Text Specifies or retrieves the text of the control.
Method Description
GetltemText Gets the text of the given item.
SelectAll Selects the text appearing in the control.
Select Activates a control and is inherited from the Control class.
Event Description
DropDown Occurs when the drop-down portion of the control is displayed.
SelectedlndexChanged Occurs when the value of the selectedlndex property is modified.
SelectedValueChanged Occurs when the value of the SelectedValue property is modified.
Slide 25 of 3809/20/13
Slide 26 of 3809/20/13
"LinkLabel" Control
- The LinkLabel control is similar to the Label control, but allows you to display its caption as a
hyperlink.

More Related Content

What's hot

Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinForm
Hock Leng PUAH
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
Aarti P
 
Step bystep abap_field help or documentation
Step bystep abap_field help or documentationStep bystep abap_field help or documentation
Step bystep abap_field help or documentation
Milind Patil
 
Chapter 10.1.4
Chapter 10.1.4Chapter 10.1.4
Chapter 10.1.4
patcha535
 
Step by step abap_input help or lov
Step by step abap_input help or lovStep by step abap_input help or lov
Step by step abap_input help or lov
Milind Patil
 
Vb6 ch.8-3 cci
Vb6 ch.8-3 cciVb6 ch.8-3 cci
Vb6 ch.8-3 cci
Fahim Khan
 

What's hot (19)

Controls events
Controls eventsControls events
Controls events
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinForm
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 
Intake 38 8
Intake 38 8Intake 38 8
Intake 38 8
 
Step bystep abap_field help or documentation
Step bystep abap_field help or documentationStep bystep abap_field help or documentation
Step bystep abap_field help or documentation
 
Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
 
Creating a quiz using visual basic 6
Creating a quiz using visual basic 6Creating a quiz using visual basic 6
Creating a quiz using visual basic 6
 
Visual basic
Visual basicVisual basic
Visual basic
 
Maliram poonia project
Maliram poonia projectMaliram poonia project
Maliram poonia project
 
User define data type In Visual Basic
User define data type In Visual Basic User define data type In Visual Basic
User define data type In Visual Basic
 
Chapter 10.1.4
Chapter 10.1.4Chapter 10.1.4
Chapter 10.1.4
 
Ingles 2do parcial
Ingles   2do parcialIngles   2do parcial
Ingles 2do parcial
 
Graphical User Interface (Gui)
Graphical User Interface (Gui)Graphical User Interface (Gui)
Graphical User Interface (Gui)
 
Form personalization 395117_r12_updated1212
Form personalization 395117_r12_updated1212Form personalization 395117_r12_updated1212
Form personalization 395117_r12_updated1212
 
Vb 6ch123
Vb 6ch123Vb 6ch123
Vb 6ch123
 
Step by step abap_input help or lov
Step by step abap_input help or lovStep by step abap_input help or lov
Step by step abap_input help or lov
 
Graphical User Interface in JAVA
Graphical User Interface in JAVAGraphical User Interface in JAVA
Graphical User Interface in JAVA
 
Advance communication system manual
Advance communication system manualAdvance communication system manual
Advance communication system manual
 
Vb6 ch.8-3 cci
Vb6 ch.8-3 cciVb6 ch.8-3 cci
Vb6 ch.8-3 cci
 

Similar to Session 1. Bai 1 ve winform

Qtp Training
Qtp TrainingQtp Training
Qtp Training
mehramit
 
Practicalfileofvb workshop
Practicalfileofvb workshopPracticalfileofvb workshop
Practicalfileofvb workshop
dhi her
 
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docxLab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
smile790243
 
Qtp Presentation
Qtp PresentationQtp Presentation
Qtp Presentation
techgajanan
 

Similar to Session 1. Bai 1 ve winform (20)

VB.Net-Controls and events
VB.Net-Controls and eventsVB.Net-Controls and events
VB.Net-Controls and events
 
unit3.2 (1).pptx
unit3.2 (1).pptxunit3.2 (1).pptx
unit3.2 (1).pptx
 
WPF Controls
WPF ControlsWPF Controls
WPF Controls
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
 
data binding.docx
data binding.docxdata binding.docx
data binding.docx
 
Unit2
Unit2Unit2
Unit2
 
CheckBox In C#.pptx
CheckBox In C#.pptxCheckBox In C#.pptx
CheckBox In C#.pptx
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
XPages Workshop: Concepts And Exercises
XPages Workshop:   Concepts And ExercisesXPages Workshop:   Concepts And Exercises
XPages Workshop: Concepts And Exercises
 
Intake 38 9
Intake 38 9Intake 38 9
Intake 38 9
 
C# Tutorial MSM_Murach chapter-10-slides
C# Tutorial MSM_Murach chapter-10-slidesC# Tutorial MSM_Murach chapter-10-slides
C# Tutorial MSM_Murach chapter-10-slides
 
Combo box and List box in VB.Net.ppt
Combo box and List box in VB.Net.pptCombo box and List box in VB.Net.ppt
Combo box and List box in VB.Net.ppt
 
Qtp Training
Qtp TrainingQtp Training
Qtp Training
 
Practicalfileofvb workshop
Practicalfileofvb workshopPracticalfileofvb workshop
Practicalfileofvb workshop
 
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docxLab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
 
Csphtp1 12
Csphtp1 12Csphtp1 12
Csphtp1 12
 
Using macros in microsoft access
Using macros in microsoft accessUsing macros in microsoft access
Using macros in microsoft access
 
Qtp Presentation
Qtp PresentationQtp Presentation
Qtp Presentation
 
engineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.pptengineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.ppt
 
ToolboxST Basics for safety at all workplace.pptx
ToolboxST Basics for safety at all workplace.pptxToolboxST Basics for safety at all workplace.pptx
ToolboxST Basics for safety at all workplace.pptx
 

More from mrtom16071980 (8)

Bai giang-ms-excel-2010
Bai giang-ms-excel-2010Bai giang-ms-excel-2010
Bai giang-ms-excel-2010
 
7314 l10 pwerpoint
7314 l10 pwerpoint7314 l10 pwerpoint
7314 l10 pwerpoint
 
hoc ve xml
hoc ve xmlhoc ve xml
hoc ve xml
 
Session 8 Bai 8 ve winform
Session 8 Bai 8 ve winformSession 8 Bai 8 ve winform
Session 8 Bai 8 ve winform
 
Session 6 Bai 6 ve winform
Session 6 Bai 6 ve winformSession 6 Bai 6 ve winform
Session 6 Bai 6 ve winform
 
Session 5 Bai 5 ve winform
Session 5 Bai 5 ve winformSession 5 Bai 5 ve winform
Session 5 Bai 5 ve winform
 
Session 4 Bai 4 ve winform
Session 4 Bai 4 ve winformSession 4 Bai 4 ve winform
Session 4 Bai 4 ve winform
 
Session 7 Bai 7 ve winform
Session 7 Bai 7 ve winformSession 7 Bai 7 ve winform
Session 7 Bai 7 ve winform
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Session 1. Bai 1 ve winform

  • 1. Session 1 Trình bày : Võ Ngọc Đạt Email : vongocdatit@gmail.com Điện thoại : 0934.969.680 Slide 1 of 3809/20/13 Windows Forms and Basic Controls
  • 2. Slide 2 of 2609/20/13 This module provides an overview of Windows Forms and the basic controls used to create graphical user interfaces. Module Introduction A Windows Form is a window used to hold various controls. These controls are graphical objects that facilitate user interaction to accept data or to display information.
  • 3. Slide 3 of 3809/20/13 Windows Forms Windows Forms allows the developer to create user interfaces using various built-in components. The applications created using Windows Forms are executed on the local machine. The form can access the resources of the local machine such as memory, printer, folders, and files. The role of Windows Forms include: + Holding controls + Handling user input + Displaying information + Connecting to database, which might exists on another machine
  • 4. Slide 4 of 3809/20/13 Windows Forms in .NET Framework
  • 5. Slide 5 of 3809/20/13 "Form" Class - The basic unit of an application is a form. - A form is a container that holds and manages controls and is used to create GUI based Windows applications. - A Windows Form application will have at least one form (window) - Create a form in an application by creating an object of the Form class System.Windows. Form namespace.
  • 6.
  • 7. Slide 7 of 3809/20/13 Property Description ForeColor Specifies or retrieves the foreground color. Location Specifies or retrieves the co-ordinates of the upper left corner of the form. Modal Specifies or retrieves a value indicating whether the form is shown modally. This means if the user tries to activate another window or form, the user cannot do so without closing the current modal form. WindowState Specifies or retrieves a value indicating whether a form is minimized, maximized, or is in the normal state. Method Description Activate Activates a form and gives it focus. Focus Puts the focus on a control. Event Description Activated Occurs when the form is activated in code or by the user. Click Occurs when a control in clicked. Deactivate Occurs when the focus on the form is taken away in code or by the user. FormClosed Occurs after the form is closed. GotFocus Occurs when the focus is put on a control of the form. Resize Occurs when a control on the form is resized. Validated Occurs when validation is completed by a control. For example, the event is raised after validating the login details in the TextBox control.
  • 8. Slide 8 of 3809/20/13
  • 9. Slide 9 of 3809/20/13 Lifecycle of Windows Forms
  • 10. Slide 10 of 3809/20/13 Types of Controls Microsoft Visual Studio provides different types of controls for Windows Forms programming.
  • 11. Slide 11 of 3809/20/13 Types A control is associated with its respective built-in class defined in the System.Windows.Forms namespace. For example, the Label control is associated with the Label class. Each control class consists of various properties, methods, and events
  • 12. Slide 12 of 3809/20/13 "Control" Class The Control class is the base class of all the controls The class is defined in System.Windows.Forms namespace and defines various properties, methods, and events.
  • 13. Slide 13 of 3809/20/13
  • 14. Slide 14 of 3809/20/13 Property Description Controls Retneves a collection of controls contained within the control. Name Specifies or retrieves the name of a control. Parent Specifies or retrieves the parent container of the control. Method Description Focus Sets input focus to the control. Hide Hides the control from the user. Select Activates a control. Show Displays the control. Event Description Click Occurs when a control is clicked. ControlAdded Occurs when a new control is added to the Control . Doubleclick Occurs when the control is double-clicked. GotFocus Occurs when the focus is on the control. Leave Occurs when the input focus leaves the control. LostFocus Occurs when the control loses focus. Move Occurs when the user moves the control. TextChanged Occurs when the value of the Text property changes.
  • 15. Slide 15 of 3809/20/13 "Label" Control - The Label control is a control that is used to show detailed information, which cannot be modified by the user. - The most common purpose of the Label control is to provide captions to the controls
  • 16. Slide 16 of 3809/20/13 "TextBox" Controls - The TextBox control takes the required information from the user, which can be modified. For example, you can create a TextBox control to accept the name of the student. Property Description CharacterCasing Specifies whether the characters should be converted to uppercase or lowercase. MaxLength Specifies or retrieves the maximum number of characters that the user can enter in the control. MultiLine Specifies or retrieves a value indicating whether the user can enter multi-line text. Name Specifies or retrieves the name of the control. PasswordChar Specifies or retrieves the special character used to mask characters of a password. Readonly Specifies or retrieves a value whether the text in the control is editable. Text Specifies or retrieves the text on the control.
  • 17. Slide 17 of 3809/20/13 Method Description AppendText Adds text to the existing text of the control. Clear Removes text from the control. Copy Copies the selected text in the control to the Clipboard. Focus Sets the input focus on the control to enter text. Paste Replaces the selected text in the control with the text copied to the Clipboard. Event Description KeyPress Occurs when the user has finished pressing a key. Leave Occurs when the control is no longer the active control of the form. TextChanged Occurs when the value of the Text property changes.
  • 18. Slide 18 of 3809/20/13 Property Description Mask Specifies or retrieves the characters to be used as a mask. MaskCompleted Retrieves a value indicating whether the user has entered all the required characters into the input mask. Name Specifies or retrieves the name of the control. PromptChar Specifies or retrieves the character to be used for prompting the user if the user has missed some input. Text Specifies or retrieves the text on the control. "MaskedTextBox" Controls - The MaskedTextBox control is a new control used to validate user input.
  • 19. Slide 19 of 3809/20/13 "Button" Control The Button control provides the easiest way to allow the user to interact with an application. The user can click the button to perform the required action.
  • 20. Slide 20 of 3809/20/13 Property Description DialogResult Specifies or retrieves a value which is sent to the parent form when a button is clicked. Enabled Specifies or retrieves a value indicating whether the control can be accessed by the user. FlatStyle Specifies or retrieves the flat style of the control, which can be Flat, standard, Popup, or System. Image Specifies or retrieves the image on the control. Name Specifies or retrieves the name of the control. Text Specifies or retrieves the text on the control. Method Description Focus Sets the focus on the control. PerformClick Triggers a Click event for a button. Event Description Click Occurs when the control is clicked. Doubleclick Occurs when the control is double-clicked. MouseDoubleClick Occurs when the control is double-clicked using the mouse.
  • 21. Slide 21 of 3809/20/13 "ListBox" and "ComboBox" Controls - The ListBox control is a control used to select a single value or multiple values from the given list of values. - The ComboBox control is similar to the ListBox control, but it allows you to select only one value at a time.
  • 22. Slide 22 of 3809/20/13 Property Description Items Retrieves the items of the control. SelectionMode Specifies or retrieves the way in which items are selected in the control, which can be: + None: For not selecting any item + One: For single selection + MultiSimple: For multiple selections + MultiExtended: For multiple selections using the Shift + Mouse click, Shift+ Arrow keys, or Ctrl+ Mouse click. Selectedlndex Specifies or retrieves the zero-based index number of the selected item in the control. Text Specifies or retrieves the text of the selected item in the control. Method Description ClearSelected Deselects all the selected items in the control. GetltemText Retrieves the text of the given item. GetSelected Returns true if the specified item is selected and returns false if the specified item is not selected. SetSelected Selects or removes the selection for a specified item. Event Description SelectedlndexChanged Occurs when the value of the Selectedlndex property is modified. SelectedValueChanged Occurs when the value of the SelectedValue property is modified. "ListBox" Controls
  • 23. Slide 23 of 3809/20/13
  • 24. Slide 24 of 3809/20/13 "ComboBox" Controls Property Description DropDownStyle Specifies or retrieves a value indicating the style of the control. The appearance of the control can be changed to Simple, DropDown, and DropDownList styles. Items Retrieves the object containing the items of the control. MaxDropDownItems Specifies or retrieves the maximum number of items to be displayed in the control. Selectedltem Specifies or retrieves the selected item in the control. Selectedlndex Specifies or retrieves the zero-based index number of the selected item in the control. Text Specifies or retrieves the text of the control. Method Description GetltemText Gets the text of the given item. SelectAll Selects the text appearing in the control. Select Activates a control and is inherited from the Control class. Event Description DropDown Occurs when the drop-down portion of the control is displayed. SelectedlndexChanged Occurs when the value of the selectedlndex property is modified. SelectedValueChanged Occurs when the value of the SelectedValue property is modified.
  • 25. Slide 25 of 3809/20/13
  • 26. Slide 26 of 3809/20/13 "LinkLabel" Control - The LinkLabel control is similar to the Label control, but allows you to display its caption as a hyperlink.