 ComboBox се нарича още падащ списък.  Падащия списък е аналогичен на ListBox, но със следните разлики:  имаме право на един избор;  не виждаме целия.

Slides:



Advertisements
Similar presentations
Lists, Loops, Validation, and More
Advertisements

Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 5- 1 STARTING OUT WITH Visual Basic 2008 FOURTH EDITION Tony Gaddis.
VB List(Of type) A List can be thought of as an array that automatically adjusts its size as elements are added and removed A List may hold only objects.
Working with Intrinsic Controls and ActiveX Controls
Microsoft Visual Basic: Reloaded Chapter Seven More on the Repetition Structure.
COMPREHENSIVE Word Tutorial 9 Creating On-Screen Forms Using Advanced Table Techniques.
Course ILT Formatting characters and paragraphs Unit objectives Change the appearance of text by applying character formatting Align text by using tabs.
1 Lab6 Lab6 ComboBox Control Properties, Methods and Events.
VB.Net Loops.
VBA Modules, Functions, Variables, and Constants
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
Programming Based on Events
VB Default Controls List Box, Combo Box
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
ListBoxes The list box control allows the user to view and select from multiple items in a list. CheckedListBox control extends a list box by including.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Group Boxes and Panels Arrange components on a GUI Buttons and etc. can be placed inside a group box or panel. All these buttons move together when the.
List-based Controls. Slide 2 Introduction There are several controls that work with lists ComboBox ListBox CheckedListBox.
VB.Net Loops. Loop FOR index – start TO end [STEP step] [statements] [EXIT FOR] NEXT index DO [{WHILE| UNTIL} condition] [statements] [EXIT DO] LOOP.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 3 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Basic.NET GUI Chapter 3 Week 13 Tariq Aziz and Kevin Jones.
Programming with Microsoft Visual Basic th Edition
Tutorial 7: Sub and Function Procedures1 Tutorial 7 Sub and Function Procedures.
Programming with Microsoft Visual Basic th Edition CHAPTER SEVEN SUB AND FUNCTION PROCEDURES.
Programming with Microsoft Visual Basic 2012 Chapter 7: Sub and Function Procedures.
BIM313 – Advanced Programming Simple Controls 1. Contents Traditional Controls – Labels, Text Boxes, Buttons, Check Boxes, List Boxes, Combo Boxes Advanced.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
1 Graphical User Interfaces Part 2 Outline ListBoxes and CheckedListBoxes ListBoxes CheckedListBoxes ComboBoxes.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
110 M - 1 ListBoxes & ComboBoxes Provide a list for the user to select from Various styles, choose based on –Amount of data to be displayed –Space available.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Seven More on the Repetition Structure.
6.3 List Boxes and Loops Some Properties, Methods, and Events of List Boxes List Boxes Populated with Strings List Boxes Populated with Numbers Searching.
Chapter 9 - VB.Net by Schneider1 Chapter 9 – Additional Controls and Objects 9.1 List Boxes, Combo Boxes, and the File-Opening Control The List Box Control.
ListBox, ComboBox, Menu Chapter 5.4, ComboBox Control: Properties & Methods u Combines TextBox features with a short drop- down list  cboOne.AddItem(string)
1. Chapter 4 Customizing Paragraphs 3 More Paragraph Changes Highlight a paragraph in Word by applying borders and shading. Sort paragraphs to control.
Graphical User Interfaces 2 Tonga Institute of Higher Education.
© 1999, by Que Education and Training, Appendix A, pages of Introduction to Computer Programming with Visual Basic 6: A Problem-Solving Approach.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 17 – Flag Quiz Application Introducing One-Dimensional.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
7-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Ten Structures and Sequential Access Files.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al- ajmi Chapter 3 Some Visual Basic Controls and Events Visual Basic. NET.
Controls. Common properties Height – Height of the control Left – Left of the control Width – width of a control Top - From the screen top Font – Foreground.
AdditionalControls 1. The MenuStrip 2 Double-click Let’s begin to design the menu bar for VB! Let’s begin to design the menu bar for VB! 3.
 A ListBox control displays a list of items and allows the user to select one or more  Drag from Toolbox to create this control on a form.
Chapter 4 Getting Started with VBA. Subroutines Subroutine is the logical section of code that performs a particular task. Subroutine is also called a.
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
Iterations (aka Loops). 2 Loops Loops (iterations) are segments of code that may be executed several times. Fixed-count (definite) loops repeat a fixed.
List Boxes and Combo Boxes Provides a list of items to select from Various styles — choose based on Space available Need to select from an existing list.
Unit 6 Repetition Processing Instructor: Brent Presley.
Variables and Expressions Programming Right from the Start with Visual Basic.NET 1/e 7.
IMS 3253: Controls 1 Dr. Lawrence West, MIS Dept., University of Central Florida Topics Check Boxes Radio Buttons Date Time Picker Masked.
Click to edit Master text styles Stacks Data Structure.
ListBox and ComboBox Controls 7.5 – Book One on the computers.
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
Microsoft Visual Basic 2008: Reloaded Third Edition
Chapter 9 Programming Based on Events
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Microsoft Visual Basic 2005 BASICS
Repeating Program Instructions
Custom dialog boxes Unit objectives
Microsoft Visual Basic 2005: Reloaded Second Edition
The List Box Control Items can be placed into the list at design time or run time The Sorted property causes items in the list to be sorted automatically.
Microsoft Visual Basic 2005 BASICS
CIS16 Application Development and Programming using Visual Basic.net
Lecture Set 10 Windows Controls and Forms
Web Development Using ASP .NET
Presentation transcript:

 ComboBox се нарича още падащ списък.  Падащия списък е аналогичен на ListBox, но със следните разлики:  имаме право на един избор;  не виждаме целия списък- това спестява място.  Възможности- аналогични на ListBox.

PropertyDescription AllowSelection Gets a value indicating whether the list enables selection of list items. AutoCompleteCustomSource Gets or sets a custom System.Collections.Specialized.StringCollection to use when the AutoCompleteSourceproperty is set to CustomSource. AutoCompleteMode Gets or sets an option that controls how automatic completion works for the ComboBox. AutoCompleteSource Gets or sets a value specifying the source of complete strings used for automatic completion. DataBindingsGets the data bindings for the control.

DataManagerGets the CurrencyManager associated with this control. DataSourceGets or sets the data source for this ComboBox. DropDownHeight Gets or sets the height in pixels of the drop-down portion of the ComboBox. DropDownStyleGets or sets a value specifying the style of the combo box. DropDownWidth Gets or sets the width of the of the drop-down portion of a combo box. DroppedDown Gets or sets a value indicating whether the combo box is displaying its drop-down portion. FlatStyleGets or sets the appearance of the ComboBox. ItemHeightGets or sets the height of an item in the combo box.

Items Gets an object representing the collection of the items contained in this ComboBox. MaxDropDownItems Gets or sets the maximum number of items to be displayed in the drop-down part of the combo box. MaxLength Gets or sets the maximum number of characters a user can enter in the editable area of the combo box. SelectedIndexGets or sets the index specifying the currently selected item. SelectedItemGets or sets currently selected item in the ComboBox. SelectedText Gets or sets the text that is selected in the editable portion of a ComboBox. SelectedValue Gets or sets the value of the member property specified by the ValueMember property. SelectionLength Gets or sets the number of characters selected in the editable portion of the combo box. SelectionStart Gets or sets the starting index of text selected in the combo box. Sorted Gets or sets a value indicating whether the items in the combo box are sorted. TextGets or sets the text associated with this control.

Method NameDescription BeginUpdate Prevents the control from drawing until the EndUpdate method is called, while items are added to the ComboBox one at a time. EndUpdate Resumes drawing of a ComboBox after it was turned off by the BeginUpdate method. FindString Finds the first item in the ComboBox that starts with the string specified as an argument. FindStringExact Finds the first item in the ComboBox that exactly matches the specified string. SelectAll Returns a value indicating whether the specified item is selected.

Създайте следния потребителки интерфейс.

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click If ComboBox1.SelectedIndex > -1 Then Dim sindex As Integer sindex = ComboBox1.SelectedIndex Dim sitem As Object sitem = ComboBox1.SelectedItem ListBox1.Items.Add(sitem) End If End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click ComboBox1.Items.Clear() ComboBox1.Items.Add("Safety") ComboBox1.Items.Add("Security") ComboBox1.Items.Add("Governance") ComboBox1.Items.Add("Good Music") ComboBox1.Items.Add("Good Movies") ComboBox1.Items.Add("Good Books") ComboBox1.Items.Add("Education") ComboBox1.Items.Add("Roads") ComboBox1.Items.Add("Health") ComboBox1.Items.Add("Food for all") ComboBox1.Items.Add("Shelter for all") ComboBox1.Items.Add("Industrialisation") ComboBox1.Items.Add("Peace") ComboBox1.Items.Add("Liberty") ComboBox1.Items.Add("Freedom of Speech") ComboBox1.Text = "Select from..." End Sub