Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



List box and Combo Box in Visual basic

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 02-01-2011
Member
 
Join Date: Dec 2010
Posts: 10
List box and Combo Box in Visual basic
  

Hello friends, I wanted to know about the List box and combo box in visual basic. I am confused whether both are same or different. One of my friends is that it is different. If it is different than the properties of List box and combo box should also differ. I am not sure whether it different or not. So, if anyone having any idea or have any knowledge then please let me know as soon as possible.

Reply With Quote
  #2  
Old 02-01-2011
Member
 
Join Date: May 2009
Posts: 503
Re: List box and Combo Box in Visual basic

List Box and Combo Box can add items at design time. This can be easily achieved Select the control by clicking it. The List property holds the list of items for combo box or list box. In the Properties Window click on the down arrow besides the List property to drop down the empty list. Type the first item name and press Ctrl + Enter. Continue typing the item names and pressing Ctrl + Enter until you are finished. On the last item do not press Ctrl + Enter. Just press Enter or click off the list. Properties for List BoxColumnsReturns or sets a value that determines whether a ListBox control scrolls vertically or horizontally and how the items in the columns are displayed
Reply With Quote
  #3  
Old 02-01-2011
Member
 
Join Date: Apr 2009
Posts: 484
Re: List box and Combo Box in Visual basic

One thing you should know that if it scrolls horizontally, the Columns property determines how many columns are displayed. SelectedReturns or sets the selection status of an item.General form: object.Selected(index) = [boolean]Properties for List Box and Combo Box StylePlease ListIndexDescription: At run-time, when an item in the list is selected(highlighted), its index is stored in the ListIndex property. Indexes start from 0. If none of the items is selected, ListIndex is set to -1. It may be used in code to select or deselect an item in a list. Examples:
lstStudents.ListIndex = 3 ' Selects the 4th itemcboColleges.ListIndex = -1 '
Deselect all items
Reply With Quote
  #4  
Old 02-01-2011
Member
 
Join Date: May 2009
Posts: 523
Re: List box and Combo Box in Visual basic

It contains the number of items in the list. It is always one greater than the highest List Index Example: TotalStudents = lstStudents.ListCount ListDescription: It is an array of items in the list. The items in the list can be accessed by specifying the index of the item. General Form: Object.List (Index) [ = Value ] Example: lstStudents.List(5) = "Salil" ' Set the 6th item to "Salil" Me.Print cboColleges.List(3) ' Print the 4th item on the formItemDataDescription.
Reply With Quote
  #5  
Old 02-01-2011
Member
 
Join Date: May 2009
Posts: 532
Re: List box and Combo Box in Visual basic

Every item in the list has an integer value associated with it. ItemData is an array of those values. The item data of an item in the list can be accessed by specifying the index of the item.General Form: Object.ItemData (Index) [ = Value ] Example: lstStudents.ItemData(5) = 10 ' Set the item data of the 6th item to 10 Me.Print cboColleges.ItemData(3) ' Print the item data of the 4th item on the formNewIndexi.Contains the index of the last item added to the list. If no items are added to the list, it contains -1. SortedIf set to True, the list is sorted alphabetically. TopIndexReturns or sets a value that specifies which item in the list is displayed in the topmost position
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "List box and Combo Box in Visual basic"
Thread Thread Starter Forum Replies Last Post
What is the use of Dialog box in Visual Basic? Alibamu Software Development 5 02-01-2011 11:47 PM
what are Visual Basic IDE? Naresh Modi Software Development 2 06-03-2009 09:49 AM
Is GUI same like Visual Basic ? Caesar Software Development 2 02-03-2009 01:32 PM
Visual Basic 2005 or Visual Basic 6 Aasha Software Development 5 15-01-2009 06:56 PM
Visual Basic on LAN djbbenn Software Development 2 05-08-2008 02:15 PM


All times are GMT +5.5. The time now is 07:55 PM.