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 WinFormHock Leng PUAH
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0Aarti 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 documentationMilind Patil
 
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 6Ella Marie Wico
 
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 Shubham Dwivedi
 
Chapter 10.1.4
Chapter 10.1.4Chapter 10.1.4
Chapter 10.1.4patcha535
 
Graphical User Interface (Gui)
Graphical User Interface (Gui)Graphical User Interface (Gui)
Graphical User Interface (Gui)Bilal Amjad
 
Form personalization 395117_r12_updated1212
Form personalization 395117_r12_updated1212Form personalization 395117_r12_updated1212
Form personalization 395117_r12_updated1212flower705
 
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 lovMilind Patil
 
Graphical User Interface in JAVA
Graphical User Interface in JAVAGraphical User Interface in JAVA
Graphical User Interface in JAVAsuraj pandey
 
Advance communication system manual
Advance communication system manualAdvance communication system manual
Advance communication system manualanuruddhsharma1
 
Vb6 ch.8-3 cci
Vb6 ch.8-3 cciVb6 ch.8-3 cci
Vb6 ch.8-3 cciFahim 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

VB.Net-Controls and events
VB.Net-Controls and eventsVB.Net-Controls and events
VB.Net-Controls and eventsPrachi Sasankar
 
CheckBox In C#.pptx
CheckBox In C#.pptxCheckBox In C#.pptx
CheckBox In C#.pptxSlemanIsmail
 
XPages Workshop: Concepts And Exercises
XPages Workshop:   Concepts And ExercisesXPages Workshop:   Concepts And Exercises
XPages Workshop: Concepts And Exercisesddrschiw
 
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-slidesSami Mut
 
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.pptUjwala Junghare
 
Qtp Training
Qtp TrainingQtp Training
Qtp Trainingmehramit
 
Practicalfileofvb workshop
Practicalfileofvb workshopPracticalfileofvb workshop
Practicalfileofvb workshopdhi 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.docxsmile790243
 
Csphtp1 12
Csphtp1 12Csphtp1 12
Csphtp1 12HUST
 
Qtp Presentation
Qtp PresentationQtp Presentation
Qtp Presentationtechgajanan
 
engineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.pptengineeringdsgtnotesofunitfivesnists.ppt
engineeringdsgtnotesofunitfivesnists.pptsharanyak0721
 
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.pptxAliyaKhan486794
 

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

Bai giang-ms-excel-2010
Bai giang-ms-excel-2010Bai giang-ms-excel-2010
Bai giang-ms-excel-2010mrtom16071980
 
Session 8 Bai 8 ve winform
Session 8 Bai 8 ve winformSession 8 Bai 8 ve winform
Session 8 Bai 8 ve winformmrtom16071980
 
Session 6 Bai 6 ve winform
Session 6 Bai 6 ve winformSession 6 Bai 6 ve winform
Session 6 Bai 6 ve winformmrtom16071980
 
Session 5 Bai 5 ve winform
Session 5 Bai 5 ve winformSession 5 Bai 5 ve winform
Session 5 Bai 5 ve winformmrtom16071980
 
Session 4 Bai 4 ve winform
Session 4 Bai 4 ve winformSession 4 Bai 4 ve winform
Session 4 Bai 4 ve winformmrtom16071980
 
Session 7 Bai 7 ve winform
Session 7 Bai 7 ve winformSession 7 Bai 7 ve winform
Session 7 Bai 7 ve winformmrtom16071980
 

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 in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Recently uploaded (20)

Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

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.