SlideShare a Scribd company logo
Unit 2 - GUI Design and Event
Driven Programming
Ms. Yagni Desai
Windows Form
• It is a graphical user interface on which the information can
be display, either textual or graphical.
• They are the basic object used to develop an application, it
also contains the coding as well as the controls.
• It is the base on which user interface can be developed.
• Forms is created by default when a Project is created with a
default name Form1.
• Every form has its own Properties, Methods and Events.
• The form properties name, caption are changed as
required, since multiple forms will be used in a Project.
Windows Form
• The support for the windows forms is provided in
System.Windows.Forms namespace.
• The Form class is from System.Windows.Forms.Form
namespace.
• Form class is based on Control class.
• The hierarchy of the Form class:
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ScrollableContol
System.Windows.Forms.ContainerControl
System.Windows.Forms.Form
Title
Control Box
Client Area
• Title: It display the title of
form.
• Control Box:
Maximize, Minimize and
cancel buttons.
• Client Area: the main area of the form in which user
interface can be created by placing the control is called
client area.
Property Description
Size Gets or sets the size of the form.
StartPosition Gets or sets the starting position of the form at run
time.
Text Gets or sets the text associated with this form.
Visible Gets or sets a value indicating if the form is visible.
Width Gets or sets the width of the form.
WindowState Gets or sets the form's window state.
Windows Form Properties
Property Description
AcceptButton Gets or sets the button on the form that is pressed
when the user uses the Enter key.
ActiveMdiChild Gets the currently active multiple document
interface (MDI) child window.
BackColor Gets or sets the background color for this form.
BackgroundImage Gets or sets the background image in the form.
CancelButton Indicates the button control that is pressed when the
user presses the ESC key.
ContextMenu Gets or sets the shortcut menu for this form.
Controls Gets or sets the collection of controls contained
within the form.
Cursor Gets or sets the cursor that is displayed when the
user moves the mouse pointer over this form.
Property Description
Enabled Gets or sets a value indicating if the form is enabled.
Focused Indicates if the form has input focus.
ForeColor Gets or sets the foreground color of the form.
Height Gets or sets the height of the form.
Icon Gets or sets the icon for the form.
IsMdiChild Indicates if the form is an MDI child form.
IsMdiContainer Gets or sets a value indicating if the form is a
container for MDI child forms.
MdiChildren Returns an array of forms of the MDI child forms
that are parented to this form.
MdiParent Gets or sets the current MDI parent form of this
form.
Methods of Form
Method Description
Close Closes the form.
Contains Indicates if the specified control is a child of
this form.
Focus Gives the form the focus.
Hide Hides the form.
SetDesktopLocation Sets the location of the form in desktop
coordinates.
Show Makes the form display by setting the visible
property to true.
ShowDialog Displays the form as a modal dialog box.
Events of Form
Event Description
Load Occurs before a form is displayed for the first
time.
Resize Occurs when the form is resized.
SizeChanged Occurs when the Size property value has
changed.
TextChanged Occurs when the Text property value has
changed.
Click Occurs when the form is clicked.
Closed Occurs when the form is closed.
Load Occurs before a form is displayed for the first
time.
Resize Occurs when the form is resized.
Label Control
• Labels usually are used to display text that cannot be
edited by the user.
• They are based on the Control class.
Property Description
AutoSize Sets/gets a value specifying if the control should be
automatically resized to display all its contents.
BorderStyle Sets/gets the border style for the control.
Image Sets/gets the image that is displayed on a Label.
ImageAlign Sets/gets the alignment of an image that is displayed in
the control.
PreferredHeight Gets the preferred height of the control.
PreferredWidth Gets the preferred width of the control.
TextAlign Sets/gets the alignment of text in the control.
Link Label Control
• Link labels support hyperlinks.
• It is use to make a part of the text in this control a link to a
Visual Basic object or web page.
Property Means
ActiveLinkColor Sets/gets the color for an active link.
DisabledLinkColor Sets/gets the color for a disabled link.
LinkArea Sets/gets the range in the text to treat as a link.
LinkBehavior Sets/gets a value that represents the behavior of a link.
LinkColor Sets/gets the color for a normal link.
Links Gets the collection of links in the LinkLabel control.
LinkVisited Sets/gets a value specifying if a link should be displayed as though
it had been visited.
VisitedLinkColor Sets/gets the color used for links that that have been visited.
Event of Link Label
Event Means
LinkClicked Occurs when a link is clicked inside the link label.
Button Controls
• Buttons are the plain controls that you simply click and
release.
• Buttons provide the most popular way of creating and
handling an event in your code.
Property Means
DialogResult Gets/sets the value returned to the parent form when the
button is clicked. Often used when you're creating dialog
boxes.
FlatStyle Gets/sets a flat style appearance.
Image Gets/sets an image displayed in a button.
TextAlign Gets/sets the alignment of the text in the button.
Method of Button
Method Means
PerformClick Causes a Click event for a button.
Text Box Controls
• It is box like controls in which you can enter text.
• Text boxes can be multiline, have scroll bars, be read-only
and have many other attributes.
• The TextBox class is derived from the TextBoxBase class,
which is based on Control.
System.Windows .Forms.Control
System.Windows.Forms.TextBoxBase
System.Windows.Forms.TextBox
• The Text Box control is used to get input from the user or to
display text.
• It is generally used for editable text, it can also be made
read-only.
Properties of Text Box
Property Means
Multiline Sets/gets value specifying if this is a multiline text
box control.
ReadOnly Sets/gets a value specifying if the text in the text
box is read-only.
ScrollBars Sets/gets what scroll bars should appear in a
multiline textbox.
TextAlign Sets/gets how text is aligned in a text box control.
PasswordChar Indicates character to display for password input for
single-line edit control
Methods of Text Box
Methods Means
AppendText Appends text to the current text in the text box.
Clear Clears all the text from the text box.
Copy Copy the selected text in the text box to the
clipboard.
Cut Moves the selected text in the text box to the
clipboard.
Paste Replaces the selected text in the textbox with the
contents of the clipboard.
Select Selects text in the textbox.
SelectAll Selects all the text in the textbox.
Events of Text Box
Events Means
AutoSizeChanged Occurs when the value of the AutoSize property
is changed.
Click Occurs when the text box is clicked.
ReadOnlyChanged Occurs when the value of the ReadOnly property
is changed.
Check Box Control
• Checkboxes allow the user to make multiple selections from
a number of options.
• You can click a check box to select it and click it again to
deselect it.
Property Means
Appearance Gets/sets the appearance of a checkbox.
AutoCheck Specifies if the Checked or CheckState values and the checkbox's
appearance are automatically changed when the checkbox is clicked.
CheckAlign Gets/sets the horizontal and vertical alignment of a checkbox in a
checkbox control.
Checked Gets/sets a value indicating if the checkbox is in the checked state.
CheckState Gets/sets the state of a three-state checkbox.
ThreeState Specifies if the checkbox will allow three check states rather than two.
Events of Check Box
Event Means
AppearanceChanged Occurs when the Appearance property
changes.
CheckedChanged Occurs when the Checked property
changes.
CheckStateChanged Occurs when the CheckState property
changes.
Radio Button Control
• A radio button or option button is a type of graphical user
interface element that allows the user to choose only one
of a predefined set of options.
• When a user clicks on a radio button, it becomes
checked, and all other radio buttons with same group
become unchecked.
• Use a radio button when you want the user to choose
only one option.
Method Means
PerformClick Generates a Click event for the radio button,
simulating a click by a user.
Properties & Events of Radio
Button
Property Means
Appearance Gets/sets the value that determines the appearance of the
radio button.
Checked Gets/sets a value indicating whether the radio button is
checked.
FlatStyle Gets/sets the flat style appearance of the radio button.
TextAlign Gets/sets the alignment of the text in a radio button.
Event Means
AppearanceChanged Occurs when the Appearance property changes.
CheckedChanged Occurs when the value of the Checked property
changes.
Combo Box Control
• Combo box control is used to display data in a drop-
down combo box.
• The combo box is made up of two parts:
– The top part is a text box that allows the user to type part
of a list item.
– The other part is a list box that displays a list of items from
which the user can select one or more.
• You can allow the user to select an item from the list, or
enter their own data.
• If no item is selected, the SelectedIndex value is -1.
• If the first item in the list is selected, then the
SelectedIndex value is 0.
ComboBox cont…
• There are three types of combobox:
– DropDown (the default) - Includes a drop-down list
and a text box. The user can select from the list or
type in the text box.
– Simple - Includes a text box and a list, which doesn't
drop down. The user can select from the list or type in
the text box.
– DropDownList - This style allows selection only from
the drop-down list.
24
Properties of ComboBox
Property Means
DropDownStyle Gets/sets the style of the combo box.
DropDownWidth Gets/sets a combo box's drop-down part's width.
SelectedIndex Gets/sets the index of the currently selected item.
SelectedItem Gets/sets currently selected item in the combo box.
SelectedText Gets/sets the selected text in the text box part of a
combo box.
25
Methods of ComboBox
Method Means
BeginUpdate Turns off visual updating of the combo box until the
EndUpdate method is called.
EndUpdate Resumes visual updating of the combo box.
FindString Finds the first item in the combo box that begins with the
indicated string.
FindStringExact Finds the item that matches the indicated string exactly.
GetItemText Gets an item's text.
Select Selects a range of text.
SelectAll Selects all the text in the text box of the combo box.
26
Events of ComboBox
• Code
27
Event Means
DropDown Occurs when the drop-down portion of a
combo box is shown.
DropDownStyleChanged Occurs when the DropDownStyle property has
changed.
SelectedIndexChanged Occurs when the SelectedIndex property has
changed.
Listbox
• list boxes display a list of items from which
the user can select one or more.
• If there are too many items to display at
once, a scroll bar automatically appears to
let the user scroll through the list.
• In Visual Basic .NET, each item in a list
box is itself an object.
Listbox
• The SelectionMode property determines how many
list items can be selected at a time; you can set this
property as:
– MultiExtended— Multiple items can be selected, and
the user can use the Shift, Ctrl, and arrow keys to
make selections.
– MultiSimple— Multiple items can be selected.
– None— No items may be selected.
– One— Only one item can be selected.
Listbox Properties
Properties Meaning
MultiColumn You also can scroll list boxes horizontally when you set
this property to True
ScrollAlwaysVisible if True, a scroll bar always appears.
SelectedIndex Gets/sets the index of the currently selected item.
SelectedItem Gets/sets currently selected item in the combo
box.
Sorted: Default value is set to False. Set it to True if you
want the items displayed in the ListBox to be
sorted by alphabetical order.
Listbox Methods
Method Use
Count Counting the number of Items in a ListBox
RemoveAt() You can remove all items or one particular item from the
list box.
Clear() To remove all items.
Listbox Event
• CodeSelectedIndexChanged Occurs when the SelectedIndex property has
changed.

More Related Content

What's hot

Libre Office Impress Lesson 4: Spreadsheets and Charts
Libre Office Impress Lesson 4: Spreadsheets and ChartsLibre Office Impress Lesson 4: Spreadsheets and Charts
Libre Office Impress Lesson 4: Spreadsheets and Charts
Smart Chicago Collaborative
 
06 win forms
06 win forms06 win forms
06 win forms
mrjw
 
VB.Net-Controls and events
VB.Net-Controls and eventsVB.Net-Controls and events
VB.Net-Controls and events
Prachi Sasankar
 
Libre Office Impress Lesson 2: Creating a Slide Show
Libre Office Impress Lesson 2: Creating a Slide ShowLibre Office Impress Lesson 2: Creating a Slide Show
Libre Office Impress Lesson 2: Creating a Slide Show
Smart Chicago Collaborative
 
Chapter 10.1.4
Chapter 10.1.4Chapter 10.1.4
Chapter 10.1.4patcha535
 
Windowforms controls c#
Windowforms controls c#Windowforms controls c#
Windowforms controls c#
prabhu rajendran
 
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Daniel DotNet
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6
Jeanie Arnoco
 
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Daniel DotNet
 
Creating web form(For College Seminars)
Creating web form(For College Seminars)Creating web form(For College Seminars)
Creating web form(For College Seminars)
Naman Joshi
 
Libre Office Writer Lesson 4: Working with tables and templates
Libre Office Writer Lesson 4: Working with tables and templatesLibre Office Writer Lesson 4: Working with tables and templates
Libre Office Writer Lesson 4: Working with tables and templates
Smart Chicago Collaborative
 
Chapter 10.1.5
Chapter 10.1.5Chapter 10.1.5
Chapter 10.1.5patcha535
 
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
Ella Marie Wico
 
Oracle 10g Forms Lesson 9
Oracle 10g Forms Lesson 9Oracle 10g Forms Lesson 9
Oracle 10g Forms Lesson 9
KAMA3
 
Libre Office Impress Lesson 1
Libre Office Impress Lesson 1Libre Office Impress Lesson 1
Libre Office Impress Lesson 1
Smart Chicago Collaborative
 
The ms visual basic 6
The ms visual basic 6The ms visual basic 6
The ms visual basic 6Eyelean xilef
 
SPF WinForm Programs
SPF WinForm ProgramsSPF WinForm Programs
SPF WinForm Programs
Hock Leng PUAH
 
Access advanced tutorial
Access advanced tutorialAccess advanced tutorial
Access advanced tutorialcatacata1976
 
Forms Part 1
Forms Part 1Forms Part 1
Forms Part 1
kjkleindorfer
 

What's hot (19)

Libre Office Impress Lesson 4: Spreadsheets and Charts
Libre Office Impress Lesson 4: Spreadsheets and ChartsLibre Office Impress Lesson 4: Spreadsheets and Charts
Libre Office Impress Lesson 4: Spreadsheets and Charts
 
06 win forms
06 win forms06 win forms
06 win forms
 
VB.Net-Controls and events
VB.Net-Controls and eventsVB.Net-Controls and events
VB.Net-Controls and events
 
Libre Office Impress Lesson 2: Creating a Slide Show
Libre Office Impress Lesson 2: Creating a Slide ShowLibre Office Impress Lesson 2: Creating a Slide Show
Libre Office Impress Lesson 2: Creating a Slide Show
 
Chapter 10.1.4
Chapter 10.1.4Chapter 10.1.4
Chapter 10.1.4
 
Windowforms controls c#
Windowforms controls c#Windowforms controls c#
Windowforms controls c#
 
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6
 
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
 
Creating web form(For College Seminars)
Creating web form(For College Seminars)Creating web form(For College Seminars)
Creating web form(For College Seminars)
 
Libre Office Writer Lesson 4: Working with tables and templates
Libre Office Writer Lesson 4: Working with tables and templatesLibre Office Writer Lesson 4: Working with tables and templates
Libre Office Writer Lesson 4: Working with tables and templates
 
Chapter 10.1.5
Chapter 10.1.5Chapter 10.1.5
Chapter 10.1.5
 
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
 
Oracle 10g Forms Lesson 9
Oracle 10g Forms Lesson 9Oracle 10g Forms Lesson 9
Oracle 10g Forms Lesson 9
 
Libre Office Impress Lesson 1
Libre Office Impress Lesson 1Libre Office Impress Lesson 1
Libre Office Impress Lesson 1
 
The ms visual basic 6
The ms visual basic 6The ms visual basic 6
The ms visual basic 6
 
SPF WinForm Programs
SPF WinForm ProgramsSPF WinForm Programs
SPF WinForm Programs
 
Access advanced tutorial
Access advanced tutorialAccess advanced tutorial
Access advanced tutorial
 
Forms Part 1
Forms Part 1Forms Part 1
Forms Part 1
 

Viewers also liked

Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingAbha Damani
 
Arrive RoomPoint
Arrive RoomPointArrive RoomPoint
Arrive RoomPoint
Paul Richards
 

Viewers also liked (7)

Unit5
Unit5Unit5
Unit5
 
Unit6
Unit6Unit6
Unit6
 
Unit3
Unit3Unit3
Unit3
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programming
 
Unit4
Unit4Unit4
Unit4
 
Ch6
Ch6Ch6
Ch6
 
Arrive RoomPoint
Arrive RoomPointArrive RoomPoint
Arrive RoomPoint
 

Similar to Unit2

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
Ujwala Junghare
 
unit3.2 (1).pptx
unit3.2 (1).pptxunit3.2 (1).pptx
unit3.2 (1).pptx
sudharsanm56
 
CheckBox In C#.pptx
CheckBox In C#.pptxCheckBox In C#.pptx
CheckBox In C#.pptx
SlemanIsmail
 
Visual Basic.pptx
Visual Basic.pptxVisual Basic.pptx
Visual Basic.pptx
KavithaAlagumalai
 
Html forms
Html formsHtml forms
Tugas testing
Tugas testingTugas testing
Tugas testing
Astrid yolanda
 
Controls events
Controls eventsControls events
Controls events
Dalwin INDIA
 
Getting started with the visual basic editor
Getting started with the visual basic editorGetting started with the visual basic editor
Getting started with the visual basic editor
putiadetiara
 
Visual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdfVisual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdf
sheenmarie0212
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
Ahllen Javier
 
05.Blend Expression, Transformation & Animation
05.Blend Expression, Transformation & Animation05.Blend Expression, Transformation & Animation
05.Blend Expression, Transformation & Animation
Nguyen Tuan
 
Vs c# lecture1
Vs c# lecture1Vs c# lecture1
Vs c# lecture1
Saman M. Almufti
 
4.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.154.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.15
Rajes Wari
 
Textbox n label
Textbox n labelTextbox n label
Textbox n label
chauhankapil
 
tL19 awt
tL19 awttL19 awt
tL19 awt
teach4uin
 
Vp lecture1 ararat
Vp lecture1 araratVp lecture1 ararat
Vp lecture1 ararat
Saman M. Almufti
 
Maliram poonia project
Maliram poonia projectMaliram poonia project

Similar to Unit2 (20)

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
 
unit3.2 (1).pptx
unit3.2 (1).pptxunit3.2 (1).pptx
unit3.2 (1).pptx
 
CheckBox In C#.pptx
CheckBox In C#.pptxCheckBox In C#.pptx
CheckBox In C#.pptx
 
Visual Basic.pptx
Visual Basic.pptxVisual Basic.pptx
Visual Basic.pptx
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
Html forms
Html formsHtml forms
Html forms
 
Tugas testing
Tugas testingTugas testing
Tugas testing
 
Controls events
Controls eventsControls events
Controls events
 
WPF Controls
WPF ControlsWPF Controls
WPF Controls
 
Getting started with the visual basic editor
Getting started with the visual basic editorGetting started with the visual basic editor
Getting started with the visual basic editor
 
Visual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdfVisual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdf
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
05.Blend Expression, Transformation & Animation
05.Blend Expression, Transformation & Animation05.Blend Expression, Transformation & Animation
05.Blend Expression, Transformation & Animation
 
Vs c# lecture1
Vs c# lecture1Vs c# lecture1
Vs c# lecture1
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
4.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.154.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.15
 
Textbox n label
Textbox n labelTextbox n label
Textbox n label
 
tL19 awt
tL19 awttL19 awt
tL19 awt
 
Vp lecture1 ararat
Vp lecture1 araratVp lecture1 ararat
Vp lecture1 ararat
 
Maliram poonia project
Maliram poonia projectMaliram poonia project
Maliram poonia project
 

More from Abha Damani (20)

Ch14
Ch14Ch14
Ch14
 
Ch12
Ch12Ch12
Ch12
 
Ch11
Ch11Ch11
Ch11
 
Ch10
Ch10Ch10
Ch10
 
Ch08
Ch08Ch08
Ch08
 
Ch01 enterprise
Ch01 enterpriseCh01 enterprise
Ch01 enterprise
 
3 data mgmt
3 data mgmt3 data mgmt
3 data mgmt
 
2 it supp_sys
2 it supp_sys2 it supp_sys
2 it supp_sys
 
1 org.perf it supp_appl
1 org.perf it supp_appl1 org.perf it supp_appl
1 org.perf it supp_appl
 
Managing and securing the enterprise
Managing and securing the enterpriseManaging and securing the enterprise
Managing and securing the enterprise
 
Unit2
Unit2Unit2
Unit2
 
Unit 3
Unit 3Unit 3
Unit 3
 
Unit 4
Unit 4Unit 4
Unit 4
 
Unit 5
Unit 5Unit 5
Unit 5
 
Unit 6
Unit 6Unit 6
Unit 6
 
Unit 1
Unit 1Unit 1
Unit 1
 
Language processor
Language processorLanguage processor
Language processor
 
Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compiler
 
Function of device driver
Function of device driverFunction of device driver
Function of device driver
 
Unit 3 assembler and processor
Unit 3   assembler and processorUnit 3   assembler and processor
Unit 3 assembler and processor
 

Recently uploaded

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 

Recently uploaded (20)

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 

Unit2

  • 1. Unit 2 - GUI Design and Event Driven Programming Ms. Yagni Desai
  • 2. Windows Form • It is a graphical user interface on which the information can be display, either textual or graphical. • They are the basic object used to develop an application, it also contains the coding as well as the controls. • It is the base on which user interface can be developed. • Forms is created by default when a Project is created with a default name Form1. • Every form has its own Properties, Methods and Events. • The form properties name, caption are changed as required, since multiple forms will be used in a Project.
  • 3. Windows Form • The support for the windows forms is provided in System.Windows.Forms namespace. • The Form class is from System.Windows.Forms.Form namespace. • Form class is based on Control class. • The hierarchy of the Form class: System.Object System.MarshalByRefObject System.ComponentModel.Component System.Windows.Forms.Control System.Windows.Forms.ScrollableContol System.Windows.Forms.ContainerControl System.Windows.Forms.Form
  • 4. Title Control Box Client Area • Title: It display the title of form. • Control Box: Maximize, Minimize and cancel buttons. • Client Area: the main area of the form in which user interface can be created by placing the control is called client area.
  • 5. Property Description Size Gets or sets the size of the form. StartPosition Gets or sets the starting position of the form at run time. Text Gets or sets the text associated with this form. Visible Gets or sets a value indicating if the form is visible. Width Gets or sets the width of the form. WindowState Gets or sets the form's window state. Windows Form Properties
  • 6. Property Description AcceptButton Gets or sets the button on the form that is pressed when the user uses the Enter key. ActiveMdiChild Gets the currently active multiple document interface (MDI) child window. BackColor Gets or sets the background color for this form. BackgroundImage Gets or sets the background image in the form. CancelButton Indicates the button control that is pressed when the user presses the ESC key. ContextMenu Gets or sets the shortcut menu for this form. Controls Gets or sets the collection of controls contained within the form. Cursor Gets or sets the cursor that is displayed when the user moves the mouse pointer over this form.
  • 7. Property Description Enabled Gets or sets a value indicating if the form is enabled. Focused Indicates if the form has input focus. ForeColor Gets or sets the foreground color of the form. Height Gets or sets the height of the form. Icon Gets or sets the icon for the form. IsMdiChild Indicates if the form is an MDI child form. IsMdiContainer Gets or sets a value indicating if the form is a container for MDI child forms. MdiChildren Returns an array of forms of the MDI child forms that are parented to this form. MdiParent Gets or sets the current MDI parent form of this form.
  • 8. Methods of Form Method Description Close Closes the form. Contains Indicates if the specified control is a child of this form. Focus Gives the form the focus. Hide Hides the form. SetDesktopLocation Sets the location of the form in desktop coordinates. Show Makes the form display by setting the visible property to true. ShowDialog Displays the form as a modal dialog box.
  • 9. Events of Form Event Description Load Occurs before a form is displayed for the first time. Resize Occurs when the form is resized. SizeChanged Occurs when the Size property value has changed. TextChanged Occurs when the Text property value has changed. Click Occurs when the form is clicked. Closed Occurs when the form is closed. Load Occurs before a form is displayed for the first time. Resize Occurs when the form is resized.
  • 10. Label Control • Labels usually are used to display text that cannot be edited by the user. • They are based on the Control class. Property Description AutoSize Sets/gets a value specifying if the control should be automatically resized to display all its contents. BorderStyle Sets/gets the border style for the control. Image Sets/gets the image that is displayed on a Label. ImageAlign Sets/gets the alignment of an image that is displayed in the control. PreferredHeight Gets the preferred height of the control. PreferredWidth Gets the preferred width of the control. TextAlign Sets/gets the alignment of text in the control.
  • 11. Link Label Control • Link labels support hyperlinks. • It is use to make a part of the text in this control a link to a Visual Basic object or web page. Property Means ActiveLinkColor Sets/gets the color for an active link. DisabledLinkColor Sets/gets the color for a disabled link. LinkArea Sets/gets the range in the text to treat as a link. LinkBehavior Sets/gets a value that represents the behavior of a link. LinkColor Sets/gets the color for a normal link. Links Gets the collection of links in the LinkLabel control. LinkVisited Sets/gets a value specifying if a link should be displayed as though it had been visited. VisitedLinkColor Sets/gets the color used for links that that have been visited.
  • 12. Event of Link Label Event Means LinkClicked Occurs when a link is clicked inside the link label.
  • 13. Button Controls • Buttons are the plain controls that you simply click and release. • Buttons provide the most popular way of creating and handling an event in your code. Property Means DialogResult Gets/sets the value returned to the parent form when the button is clicked. Often used when you're creating dialog boxes. FlatStyle Gets/sets a flat style appearance. Image Gets/sets an image displayed in a button. TextAlign Gets/sets the alignment of the text in the button.
  • 14. Method of Button Method Means PerformClick Causes a Click event for a button.
  • 15. Text Box Controls • It is box like controls in which you can enter text. • Text boxes can be multiline, have scroll bars, be read-only and have many other attributes. • The TextBox class is derived from the TextBoxBase class, which is based on Control. System.Windows .Forms.Control System.Windows.Forms.TextBoxBase System.Windows.Forms.TextBox • The Text Box control is used to get input from the user or to display text. • It is generally used for editable text, it can also be made read-only.
  • 16. Properties of Text Box Property Means Multiline Sets/gets value specifying if this is a multiline text box control. ReadOnly Sets/gets a value specifying if the text in the text box is read-only. ScrollBars Sets/gets what scroll bars should appear in a multiline textbox. TextAlign Sets/gets how text is aligned in a text box control. PasswordChar Indicates character to display for password input for single-line edit control
  • 17. Methods of Text Box Methods Means AppendText Appends text to the current text in the text box. Clear Clears all the text from the text box. Copy Copy the selected text in the text box to the clipboard. Cut Moves the selected text in the text box to the clipboard. Paste Replaces the selected text in the textbox with the contents of the clipboard. Select Selects text in the textbox. SelectAll Selects all the text in the textbox.
  • 18. Events of Text Box Events Means AutoSizeChanged Occurs when the value of the AutoSize property is changed. Click Occurs when the text box is clicked. ReadOnlyChanged Occurs when the value of the ReadOnly property is changed.
  • 19. Check Box Control • Checkboxes allow the user to make multiple selections from a number of options. • You can click a check box to select it and click it again to deselect it. Property Means Appearance Gets/sets the appearance of a checkbox. AutoCheck Specifies if the Checked or CheckState values and the checkbox's appearance are automatically changed when the checkbox is clicked. CheckAlign Gets/sets the horizontal and vertical alignment of a checkbox in a checkbox control. Checked Gets/sets a value indicating if the checkbox is in the checked state. CheckState Gets/sets the state of a three-state checkbox. ThreeState Specifies if the checkbox will allow three check states rather than two.
  • 20. Events of Check Box Event Means AppearanceChanged Occurs when the Appearance property changes. CheckedChanged Occurs when the Checked property changes. CheckStateChanged Occurs when the CheckState property changes.
  • 21. Radio Button Control • A radio button or option button is a type of graphical user interface element that allows the user to choose only one of a predefined set of options. • When a user clicks on a radio button, it becomes checked, and all other radio buttons with same group become unchecked. • Use a radio button when you want the user to choose only one option. Method Means PerformClick Generates a Click event for the radio button, simulating a click by a user.
  • 22. Properties & Events of Radio Button Property Means Appearance Gets/sets the value that determines the appearance of the radio button. Checked Gets/sets a value indicating whether the radio button is checked. FlatStyle Gets/sets the flat style appearance of the radio button. TextAlign Gets/sets the alignment of the text in a radio button. Event Means AppearanceChanged Occurs when the Appearance property changes. CheckedChanged Occurs when the value of the Checked property changes.
  • 23. Combo Box Control • Combo box control is used to display data in a drop- down combo box. • The combo box is made up of two parts: – The top part is a text box that allows the user to type part of a list item. – The other part is a list box that displays a list of items from which the user can select one or more. • You can allow the user to select an item from the list, or enter their own data. • If no item is selected, the SelectedIndex value is -1. • If the first item in the list is selected, then the SelectedIndex value is 0.
  • 24. ComboBox cont… • There are three types of combobox: – DropDown (the default) - Includes a drop-down list and a text box. The user can select from the list or type in the text box. – Simple - Includes a text box and a list, which doesn't drop down. The user can select from the list or type in the text box. – DropDownList - This style allows selection only from the drop-down list. 24
  • 25. Properties of ComboBox Property Means DropDownStyle Gets/sets the style of the combo box. DropDownWidth Gets/sets a combo box's drop-down part's width. SelectedIndex Gets/sets the index of the currently selected item. SelectedItem Gets/sets currently selected item in the combo box. SelectedText Gets/sets the selected text in the text box part of a combo box. 25
  • 26. Methods of ComboBox Method Means BeginUpdate Turns off visual updating of the combo box until the EndUpdate method is called. EndUpdate Resumes visual updating of the combo box. FindString Finds the first item in the combo box that begins with the indicated string. FindStringExact Finds the item that matches the indicated string exactly. GetItemText Gets an item's text. Select Selects a range of text. SelectAll Selects all the text in the text box of the combo box. 26
  • 27. Events of ComboBox • Code 27 Event Means DropDown Occurs when the drop-down portion of a combo box is shown. DropDownStyleChanged Occurs when the DropDownStyle property has changed. SelectedIndexChanged Occurs when the SelectedIndex property has changed.
  • 28. Listbox • list boxes display a list of items from which the user can select one or more. • If there are too many items to display at once, a scroll bar automatically appears to let the user scroll through the list. • In Visual Basic .NET, each item in a list box is itself an object.
  • 29. Listbox • The SelectionMode property determines how many list items can be selected at a time; you can set this property as: – MultiExtended— Multiple items can be selected, and the user can use the Shift, Ctrl, and arrow keys to make selections. – MultiSimple— Multiple items can be selected. – None— No items may be selected. – One— Only one item can be selected.
  • 30. Listbox Properties Properties Meaning MultiColumn You also can scroll list boxes horizontally when you set this property to True ScrollAlwaysVisible if True, a scroll bar always appears. SelectedIndex Gets/sets the index of the currently selected item. SelectedItem Gets/sets currently selected item in the combo box. Sorted: Default value is set to False. Set it to True if you want the items displayed in the ListBox to be sorted by alphabetical order.
  • 31. Listbox Methods Method Use Count Counting the number of Items in a ListBox RemoveAt() You can remove all items or one particular item from the list box. Clear() To remove all items.
  • 32. Listbox Event • CodeSelectedIndexChanged Occurs when the SelectedIndex property has changed.