SlideShare ist ein Scribd-Unternehmen logo
1 von 32
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.

Weitere ähnliche Inhalte

Was ist angesagt?

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 ChartsSmart Chicago Collaborative
 
06 win forms
06 win forms06 win forms
06 win formsmrjw
 
VB.Net-Controls and events
VB.Net-Controls and eventsVB.Net-Controls and events
VB.Net-Controls and eventsPrachi 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 ShowSmart Chicago Collaborative
 
Chapter 10.1.4
Chapter 10.1.4Chapter 10.1.4
Chapter 10.1.4patcha535
 
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 6Jeanie 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 templatesSmart 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 6Ella Marie Wico
 
Oracle 10g Forms Lesson 9
Oracle 10g Forms Lesson 9Oracle 10g Forms Lesson 9
Oracle 10g Forms Lesson 9KAMA3
 
The ms visual basic 6
The ms visual basic 6The ms visual basic 6
The ms visual basic 6Eyelean xilef
 
Access advanced tutorial
Access advanced tutorialAccess advanced tutorial
Access advanced tutorialcatacata1976
 

Was ist angesagt? (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
 

Andere mochten auch

Andere mochten auch (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
 

Ähnlich wie 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 Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
Visual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdfVisual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdf
 
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
 

Mehr von 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
 

Kürzlich hochgeladen

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 

Kürzlich hochgeladen (20)

How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 

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.