SlideShare a Scribd company logo
Shri Shivaji Science College, Amravati
Department of Computer Science
Topic-VB.NET
Prepared By
Dr. Ujwala S. Junghare
Assistant Professor
Dept. of Computer Science
Combo box and List box
List Boxes:
• 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.
• It allows the programmer to add items at design time by using the properties window or
at the runtime.
• You can create a list box by dragging a ListBox control from the Toolbox and dropping it
on the form.
You can populate the list box items either from the properties window or at runtime.
Properties of the ListBox Control:
Sr.No
.
Property & Description
1 AllowSelection
Gets a value indicating whether the ListBox currently enables selection of list items.
2 BorderStyle
Gets or sets the type of border drawn around the list box.
3 ColumnWidth
Gets of sets the width of columns in a multicolumn list box.
4 HorizontalExtent
Gets or sets the horizontal scrolling area of a list box.
5 HorizontalScrollBar
Gets or sets the value indicating whether a horizontal scrollbar is displayed in the list box.
6 ItemHeight
Gets or sets the height of an item in the list box.
7 Items
Gets the items of the list box.
8 MultiColumn
Gets or sets a value indicating whether the list box supports multiple
columns.
9 ScrollAlwaysVisible
Gets or sets a value indicating whether the vertical scroll bar is shown
at all times.
10 SelectedIndex
Gets or sets the zero-based index of the currently selected item in a list
box.
11 SelectedIndices
Gets a collection that contains the zero-based indexes of all currently
selected items in the list box.
12 SelectedItem
Gets or sets the currently selected item in the list box.
13 SelectedItems
Gets a collection containing the currently selected items in the list box.
14 SelectedValue
Gets or sets the value of the member property specified by the ValueMember property.
15 SelectionMode
Gets or sets the method in which items are selected in the list box. This property has
values −
•None
•One
•MultiSimple
•MultiExtended
16 Sorted
Gets or sets a value indicating whether the items in the list box are sorted alphabetically.
17 Text
Gets or searches for the text of the currently selected item in the list box.
18 TopIndex
Gets or sets the index of the first visible item of a list box.
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs)
Handles MyBase.Load
' Set the caption bar text of the form.
Me.Text = "tutorialspont.com"
ListBox1.Items.Add("Canada")
ListBox1.Items.Add("USA")
ListBox1.Items.Add("UK")
ListBox1.Items.Add("Japan")
ListBox1.Items.Add("Russia")
ListBox1.Items.Add("China")
ListBox1.Items.Add("India")
End Sub
Private Sub Button1_Click(sender As Object, e As
EventArgs) Handles Button1.Click MsgBox("You have selected
" + ListBox1.SelectedItem.ToString()) End Sub
Private Sub ListBox1_SelectedIndexChanged(sender As
Object, e As EventArgs) Handles
ListBox1.SelectedIndexChanged
Label2.Text = ListBox1.SelectedItem.ToString()
End Sub
End Class
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As
System.EventArgs) Handles Button1.Click
ListBox1.BeginUpdate()
Dim intLoopIndex As Integer
For intLoopIndex = 1 To 20
ListBox1.Items.Add("Item " &intLoopIndex.ToString())
Next intLoopIndex
ListBox1.EndUpdate()
End Sub
Combo box
The ComboBox control is used to display a drop-down list of various items. It is a
combination of a text box in which the user enters an item and a drop-down list from
which the user selects an item.
Let's create a combo box by dragging a ComboBox control from the Toolbox and
dropping it on the form.
Sr.No. Property & Description
1 AllowSelection
Gets a value indicating whether the list enables selection of list items.
2 AutoCompleteCustomSource
Gets or sets a custom System.Collections .Specialized.StringCollection to
use when the AutoCompleteSourceproperty is set to CustomSource.
3 AutoCompleteMode
Gets or sets an option that controls how automatic completion works for
the ComboBox.
4 AutoCompleteSource
Gets or sets a value specifying the source of complete strings used for
automatic completion.
5 DataBindings
Gets the data bindings for the control.
6 DataManager
Gets the CurrencyManager associated with this control.
7 DataSource
Gets or sets the data source for this ComboBox.
8 DropDownHeight
Gets or sets the height in pixels of the drop-down portion of the ComboBox.
9 DropDownStyle
Gets or sets a value specifying the style of the combo box.
10 DropDownWidth
Gets or sets the width of the of the drop-down portion of a combo box.
11 DroppedDown
Gets or sets a value indicating whether the combo box is displaying its drop-down portion.
12 FlatStyle
Gets or sets the appearance of the ComboBox.
13 ItemHeight
Gets or sets the height of an item in the combo box.
14 Items
Gets an object representing the collection of the items contained in this ComboBox.
15 MaxDropDownItems
Gets or sets the maximum number of items to be displayed in the drop-down part of the combo box.
16 MaxLength
Gets or sets the maximum number of characters a user can enter in the editable area of the combo box.
17 SelectedIndex
Gets or sets the index specifying the currently selected item.
18 SelectedItem
Gets or sets currently selected item in the ComboBox.
19 SelectedText
Gets or sets the text that is selected in the editable portion of a ComboBox.
20 SelectedValue
Gets or sets the value of the member property specified by the ValueMember property.
21 SelectionLength
Gets or sets the number of characters selected in the editable portion of the combo box.
22 SelectionStart
Gets or sets the starting index of text selected in the combo box.
23 Sorted
Gets or sets a value indicating whether the items in the combo box are sorted.
24 Text
Gets or sets the text associated with this control.
PictureBox Control
• The PictureBox control is used for displaying images on the form. The Image property of
the control allows you to set an image both at design time or at run time.
• Let's create a picture box by dragging a PictureBox control from the Toolbox and dropping
it on the form.
Sr.No. Property & Description
1 AllowDrop
Specifies whether the picture box accepts data that a user drags on it.
2 ErrorImage
Gets or specifies an image to be displayed when an error occurs during the image-loading process or
if the image load is cancelled.
3 Image
Gets or sets the image that is displayed in the control.
4 ImageLocation
Gets or sets the path or the URL for the image displayed in the control.
5 InitialImage
Gets or sets the image displayed in the control when the main image is loaded.
Properties of the PictureBox Control
The following are some of the commonly used properties of the PictureBox control −
6 SizeMode
Determines the size of the image to be displayed in the control. This property takes its value from the
PictureBoxSizeMode enumeration, which has values −
•Normal − the upper left corner of the image is placed at upper left part of the picture box
•StrechImage − allows stretching of the image
•AutoSize − allows resizing the picture box to the size of the image
•CenterImage − allows centering the image in the picture box
•Zoom − allows increasing or decreasing the image size to maintain the size ratio.
7 TabIndex
Gets or sets the tab index value.
8 TabStop
Specifies whether the user will be able to focus on the picture box by using the TAB key.
9 Text
Gets or sets the text for the picture box.
10 WaitOnLoad
Specifies whether or not an image is loaded synchronously.
Sr.
No.
Method Name & Description
1 CancelAsync
Cancels an asynchronous image load.
2 Load
Displays an image in the picture box
3 LoadAsync
Loads image asynchronously.
4 ToString
Returns the string that represents the current picture box.
Methods of the PictureBox Control
The following are some of the commonly used methods of the PictureBox control −
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'Dim Str As String = "C:UsersAMIT YADAVDesktop"
PictureBox1.Image = Image.FromFile("C:UsersAMIT YADAVDesktopjtp2.png")
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
PictureBox1.Height = 250
PictureBox1.Width = 400
Label1.Visible = False
End Sub
Timer Control - VB.Net
What is Timer Control ?
Timer Control plays an important role in the Client side programming and Server side programming, also used in Windows Services.
By using this Timer Control, windows allow you to control when actions take place without the interaction of another thread.
Use of Timer Control
We can use Timer Control in many situations in our development environment. If you want to run some code
after a certain interval of time continuously, you can use the Timer control. As well as to start a process at a fixed
time schedule, to increase or decrease the speed in an animation graphics with time schedule etc. you can use the
Timer Control. The Visual Studio toolbox has a Timer Control that allowing you to drag and drop the timer
controls directly onto a Windows Forms designer. At runtime it does not have a visual representation and works
as a component in the background.
How to Timer Control ?
With the Timer Control, we can control programs in millisecond, seconds, minutes and even in
hours. The Timer Control allows us to set Interval property in milliseconds (1 second is equal to
1000 milliseconds). For example, if we want to set an interval of two minute we set the value at
Interval property as 120000, means 120x1000 .
The Timer Control starts its functioning only after its Enabled property is set to True, by default
Enabled property is False.

More Related Content

What's hot

Graphics software and standards
Graphics software and standardsGraphics software and standards
Graphics software and standards
Mani Kanth
 
Visual Basic menu
Visual Basic menuVisual Basic menu
Visual Basic menu
kuldeep94
 
The msg box function and the messagebox class
The msg box function and the messagebox classThe msg box function and the messagebox class
The msg box function and the messagebox classFaisal Aziz
 
Adobe Pagemaker 7.0
Adobe Pagemaker 7.0Adobe Pagemaker 7.0
Adobe Pagemaker 7.0
ThamizhselviKrishnam
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Salim M
 
Javascript
JavascriptJavascript
Javascript
Manav Prasad
 
Adobe pagemaker
Adobe pagemakerAdobe pagemaker
Adobe pagemaker
Umamaheshwariv1
 
Photoshop layers
Photoshop layersPhotoshop layers
Photoshop layers
Marche Ygar
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
Ahllen Javier
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.net
Deep Patel
 
Introduction- The Basics of Photoshop CS6
Introduction- The Basics of Photoshop CS6Introduction- The Basics of Photoshop CS6
Introduction- The Basics of Photoshop CS6
Crest TechnoSoft
 
5. combobox
5. combobox5. combobox
5. combobox
chauhankapil
 
Html forms
Html formsHtml forms
Html forms
eShikshak
 
Charts and pivot tables
Charts and pivot tablesCharts and pivot tables
Charts and pivot tables
UttaraChattopadhyay
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
1520lakshyagupta
 
Introduction to Scratch Programming
Introduction to Scratch ProgrammingIntroduction to Scratch Programming
Introduction to Scratch Programming
StorytimeSteph
 
Access lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying FormsAccess lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying FormsAram SE
 
Asp.net html server control
Asp.net html  server controlAsp.net html  server control
Asp.net html server control
Sireesh K
 

What's hot (20)

Graphics software and standards
Graphics software and standardsGraphics software and standards
Graphics software and standards
 
Visual Basic menu
Visual Basic menuVisual Basic menu
Visual Basic menu
 
The msg box function and the messagebox class
The msg box function and the messagebox classThe msg box function and the messagebox class
The msg box function and the messagebox class
 
Adobe Pagemaker 7.0
Adobe Pagemaker 7.0Adobe Pagemaker 7.0
Adobe Pagemaker 7.0
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0
 
Javascript
JavascriptJavascript
Javascript
 
Adobe pagemaker
Adobe pagemakerAdobe pagemaker
Adobe pagemaker
 
Photoshop layers
Photoshop layersPhotoshop layers
Photoshop layers
 
Formatting Paragraphs
Formatting ParagraphsFormatting Paragraphs
Formatting Paragraphs
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.net
 
Introduction- The Basics of Photoshop CS6
Introduction- The Basics of Photoshop CS6Introduction- The Basics of Photoshop CS6
Introduction- The Basics of Photoshop CS6
 
5. combobox
5. combobox5. combobox
5. combobox
 
Html forms
Html formsHtml forms
Html forms
 
Charts and pivot tables
Charts and pivot tablesCharts and pivot tables
Charts and pivot tables
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
 
Introduction to Scratch Programming
Introduction to Scratch ProgrammingIntroduction to Scratch Programming
Introduction to Scratch Programming
 
CSS
CSSCSS
CSS
 
Access lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying FormsAccess lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying Forms
 
Asp.net html server control
Asp.net html  server controlAsp.net html  server control
Asp.net html server control
 

Similar to Combo box and List box in VB.Net.ppt

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
 
Visual basic
Visual basicVisual basic
Visual basic
KavithaAlagumalai
 
Session 3 Bai 3 ve winform
Session 3 Bai 3 ve winformSession 3 Bai 3 ve winform
Session 3 Bai 3 ve winformmrtom16071980
 
Windows Forms For Beginners Part - 3
Windows Forms For Beginners Part - 3Windows Forms For Beginners Part - 3
Windows Forms For Beginners Part - 3
Bhushan Mulmule
 
Maliram poonia project
Maliram poonia projectMaliram poonia project
TrackBar and TreeView
TrackBar and TreeViewTrackBar and TreeView
Android interface elements and controls-chapter8
Android interface elements and controls-chapter8Android interface elements and controls-chapter8
Android interface elements and controls-chapter8
Dr. Ramkumar Lakshminarayanan
 
Session 2 Bai 2 ve winform
Session 2 Bai 2 ve winformSession 2 Bai 2 ve winform
Session 2 Bai 2 ve winformmrtom16071980
 
Android Application Development - Level 2
Android Application Development - Level 2Android Application Development - Level 2
Android Application Development - Level 2
Isham Rashik
 
tL19 awt
tL19 awttL19 awt
tL19 awt
teach4uin
 
4. listbox
4. listbox4. listbox
4. listbox
chauhankapil
 
GUI -THESIS123
GUI -THESIS123GUI -THESIS123
GUI -THESIS123
Aparna Reddy
 
Textbox n label
Textbox n labelTextbox n label
Textbox n label
chauhankapil
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
Moutasm Tamimi
 

Similar to Combo box and List box in VB.Net.ppt (20)

Unit2
Unit2Unit2
Unit2
 
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
 
Visual basic
Visual basicVisual basic
Visual basic
 
Session 3 Bai 3 ve winform
Session 3 Bai 3 ve winformSession 3 Bai 3 ve winform
Session 3 Bai 3 ve winform
 
Windows Forms For Beginners Part - 3
Windows Forms For Beginners Part - 3Windows Forms For Beginners Part - 3
Windows Forms For Beginners Part - 3
 
Maliram poonia project
Maliram poonia projectMaliram poonia project
Maliram poonia project
 
WPF Controls
WPF ControlsWPF Controls
WPF Controls
 
TrackBar and TreeView
TrackBar and TreeViewTrackBar and TreeView
TrackBar and TreeView
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
Android interface elements and controls-chapter8
Android interface elements and controls-chapter8Android interface elements and controls-chapter8
Android interface elements and controls-chapter8
 
Session 2 Bai 2 ve winform
Session 2 Bai 2 ve winformSession 2 Bai 2 ve winform
Session 2 Bai 2 ve winform
 
Android Application Development - Level 2
Android Application Development - Level 2Android Application Development - Level 2
Android Application Development - Level 2
 
tL19 awt
tL19 awttL19 awt
tL19 awt
 
4. listbox
4. listbox4. listbox
4. listbox
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
GUI -THESIS123
GUI -THESIS123GUI -THESIS123
GUI -THESIS123
 
Textbox n label
Textbox n labelTextbox n label
Textbox n label
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
 

More from Ujwala Junghare

Unit IV Array in VB.Net.pptx
Unit IV Array in VB.Net.pptxUnit IV Array in VB.Net.pptx
Unit IV Array in VB.Net.pptx
Ujwala Junghare
 
Unit I Networking.pptx
Unit I Networking.pptxUnit I Networking.pptx
Unit I Networking.pptx
Ujwala Junghare
 
Unit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdfUnit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdf
Ujwala Junghare
 
Unit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdfUnit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdf
Ujwala Junghare
 
BSc. III Unit iii VB.NET
BSc. III Unit iii VB.NETBSc. III Unit iii VB.NET
BSc. III Unit iii VB.NET
Ujwala Junghare
 
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET
Unit IV-Checkboxes    and   Radio Buttons in VB.Net in VB.NET Unit IV-Checkboxes    and   Radio Buttons in VB.Net in VB.NET
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET
Ujwala Junghare
 

More from Ujwala Junghare (6)

Unit IV Array in VB.Net.pptx
Unit IV Array in VB.Net.pptxUnit IV Array in VB.Net.pptx
Unit IV Array in VB.Net.pptx
 
Unit I Networking.pptx
Unit I Networking.pptxUnit I Networking.pptx
Unit I Networking.pptx
 
Unit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdfUnit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdf
 
Unit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdfUnit I- Introduction to .NET Framework.pdf
Unit I- Introduction to .NET Framework.pdf
 
BSc. III Unit iii VB.NET
BSc. III Unit iii VB.NETBSc. III Unit iii VB.NET
BSc. III Unit iii VB.NET
 
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET
Unit IV-Checkboxes    and   Radio Buttons in VB.Net in VB.NET Unit IV-Checkboxes    and   Radio Buttons in VB.Net in VB.NET
Unit IV-Checkboxes and Radio Buttons in VB.Net in VB.NET
 

Recently uploaded

Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 

Recently uploaded (20)

Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 

Combo box and List box in VB.Net.ppt

  • 1. Shri Shivaji Science College, Amravati Department of Computer Science Topic-VB.NET Prepared By Dr. Ujwala S. Junghare Assistant Professor Dept. of Computer Science
  • 2. Combo box and List box
  • 3. List Boxes: • 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. • It allows the programmer to add items at design time by using the properties window or at the runtime. • You can create a list box by dragging a ListBox control from the Toolbox and dropping it on the form.
  • 4. You can populate the list box items either from the properties window or at runtime. Properties of the ListBox Control: Sr.No . Property & Description 1 AllowSelection Gets a value indicating whether the ListBox currently enables selection of list items. 2 BorderStyle Gets or sets the type of border drawn around the list box. 3 ColumnWidth Gets of sets the width of columns in a multicolumn list box. 4 HorizontalExtent Gets or sets the horizontal scrolling area of a list box. 5 HorizontalScrollBar Gets or sets the value indicating whether a horizontal scrollbar is displayed in the list box.
  • 5. 6 ItemHeight Gets or sets the height of an item in the list box. 7 Items Gets the items of the list box. 8 MultiColumn Gets or sets a value indicating whether the list box supports multiple columns. 9 ScrollAlwaysVisible Gets or sets a value indicating whether the vertical scroll bar is shown at all times. 10 SelectedIndex Gets or sets the zero-based index of the currently selected item in a list box. 11 SelectedIndices Gets a collection that contains the zero-based indexes of all currently selected items in the list box.
  • 6. 12 SelectedItem Gets or sets the currently selected item in the list box. 13 SelectedItems Gets a collection containing the currently selected items in the list box. 14 SelectedValue Gets or sets the value of the member property specified by the ValueMember property. 15 SelectionMode Gets or sets the method in which items are selected in the list box. This property has values − •None •One •MultiSimple •MultiExtended 16 Sorted Gets or sets a value indicating whether the items in the list box are sorted alphabetically. 17 Text Gets or searches for the text of the currently selected item in the list box. 18 TopIndex Gets or sets the index of the first visible item of a list box.
  • 7. Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load ' Set the caption bar text of the form. Me.Text = "tutorialspont.com" ListBox1.Items.Add("Canada") ListBox1.Items.Add("USA") ListBox1.Items.Add("UK") ListBox1.Items.Add("Japan") ListBox1.Items.Add("Russia") ListBox1.Items.Add("China") ListBox1.Items.Add("India") End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click MsgBox("You have selected " + ListBox1.SelectedItem.ToString()) End Sub Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged Label2.Text = ListBox1.SelectedItem.ToString() End Sub End Class
  • 8. Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click ListBox1.BeginUpdate() Dim intLoopIndex As Integer For intLoopIndex = 1 To 20 ListBox1.Items.Add("Item " &intLoopIndex.ToString()) Next intLoopIndex ListBox1.EndUpdate() End Sub
  • 10. The ComboBox control is used to display a drop-down list of various items. It is a combination of a text box in which the user enters an item and a drop-down list from which the user selects an item. Let's create a combo box by dragging a ComboBox control from the Toolbox and dropping it on the form. Sr.No. Property & Description 1 AllowSelection Gets a value indicating whether the list enables selection of list items. 2 AutoCompleteCustomSource Gets or sets a custom System.Collections .Specialized.StringCollection to use when the AutoCompleteSourceproperty is set to CustomSource. 3 AutoCompleteMode Gets or sets an option that controls how automatic completion works for the ComboBox. 4 AutoCompleteSource Gets or sets a value specifying the source of complete strings used for automatic completion. 5 DataBindings Gets the data bindings for the control.
  • 11. 6 DataManager Gets the CurrencyManager associated with this control. 7 DataSource Gets or sets the data source for this ComboBox. 8 DropDownHeight Gets or sets the height in pixels of the drop-down portion of the ComboBox. 9 DropDownStyle Gets or sets a value specifying the style of the combo box. 10 DropDownWidth Gets or sets the width of the of the drop-down portion of a combo box. 11 DroppedDown Gets or sets a value indicating whether the combo box is displaying its drop-down portion. 12 FlatStyle Gets or sets the appearance of the ComboBox. 13 ItemHeight Gets or sets the height of an item in the combo box. 14 Items Gets an object representing the collection of the items contained in this ComboBox.
  • 12. 15 MaxDropDownItems Gets or sets the maximum number of items to be displayed in the drop-down part of the combo box. 16 MaxLength Gets or sets the maximum number of characters a user can enter in the editable area of the combo box. 17 SelectedIndex Gets or sets the index specifying the currently selected item. 18 SelectedItem Gets or sets currently selected item in the ComboBox. 19 SelectedText Gets or sets the text that is selected in the editable portion of a ComboBox. 20 SelectedValue Gets or sets the value of the member property specified by the ValueMember property. 21 SelectionLength Gets or sets the number of characters selected in the editable portion of the combo box. 22 SelectionStart Gets or sets the starting index of text selected in the combo box. 23 Sorted Gets or sets a value indicating whether the items in the combo box are sorted. 24 Text Gets or sets the text associated with this control.
  • 13. PictureBox Control • The PictureBox control is used for displaying images on the form. The Image property of the control allows you to set an image both at design time or at run time. • Let's create a picture box by dragging a PictureBox control from the Toolbox and dropping it on the form.
  • 14. Sr.No. Property & Description 1 AllowDrop Specifies whether the picture box accepts data that a user drags on it. 2 ErrorImage Gets or specifies an image to be displayed when an error occurs during the image-loading process or if the image load is cancelled. 3 Image Gets or sets the image that is displayed in the control. 4 ImageLocation Gets or sets the path or the URL for the image displayed in the control. 5 InitialImage Gets or sets the image displayed in the control when the main image is loaded. Properties of the PictureBox Control The following are some of the commonly used properties of the PictureBox control −
  • 15. 6 SizeMode Determines the size of the image to be displayed in the control. This property takes its value from the PictureBoxSizeMode enumeration, which has values − •Normal − the upper left corner of the image is placed at upper left part of the picture box •StrechImage − allows stretching of the image •AutoSize − allows resizing the picture box to the size of the image •CenterImage − allows centering the image in the picture box •Zoom − allows increasing or decreasing the image size to maintain the size ratio. 7 TabIndex Gets or sets the tab index value. 8 TabStop Specifies whether the user will be able to focus on the picture box by using the TAB key. 9 Text Gets or sets the text for the picture box. 10 WaitOnLoad Specifies whether or not an image is loaded synchronously.
  • 16. Sr. No. Method Name & Description 1 CancelAsync Cancels an asynchronous image load. 2 Load Displays an image in the picture box 3 LoadAsync Loads image asynchronously. 4 ToString Returns the string that represents the current picture box. Methods of the PictureBox Control The following are some of the commonly used methods of the PictureBox control −
  • 17. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 'Dim Str As String = "C:UsersAMIT YADAVDesktop" PictureBox1.Image = Image.FromFile("C:UsersAMIT YADAVDesktopjtp2.png") PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage PictureBox1.Height = 250 PictureBox1.Width = 400 Label1.Visible = False End Sub
  • 18. Timer Control - VB.Net What is Timer Control ? Timer Control plays an important role in the Client side programming and Server side programming, also used in Windows Services. By using this Timer Control, windows allow you to control when actions take place without the interaction of another thread. Use of Timer Control We can use Timer Control in many situations in our development environment. If you want to run some code after a certain interval of time continuously, you can use the Timer control. As well as to start a process at a fixed time schedule, to increase or decrease the speed in an animation graphics with time schedule etc. you can use the Timer Control. The Visual Studio toolbox has a Timer Control that allowing you to drag and drop the timer controls directly onto a Windows Forms designer. At runtime it does not have a visual representation and works as a component in the background.
  • 19. How to Timer Control ? With the Timer Control, we can control programs in millisecond, seconds, minutes and even in hours. The Timer Control allows us to set Interval property in milliseconds (1 second is equal to 1000 milliseconds). For example, if we want to set an interval of two minute we set the value at Interval property as 120000, means 120x1000 . The Timer Control starts its functioning only after its Enabled property is set to True, by default Enabled property is False.