Results 1 to 5 of 5

Thread: List box and Combo Box in Visual basic

  1. #1
    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.

  2. #2
    Join Date
    May 2009
    Posts
    511

    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

  3. #3
    Join Date
    Apr 2009
    Posts
    488

    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

  4. #4
    Join Date
    May 2009
    Posts
    527

    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.

  5. #5
    Join Date
    May 2009
    Posts
    539

    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

Similar Threads

  1. What is the use of Dialog box in Visual Basic?
    By Alibamu in forum Software Development
    Replies: 5
    Last Post: 02-01-2011, 11:47 PM
  2. what are Visual Basic IDE?
    By Naresh Modi in forum Software Development
    Replies: 2
    Last Post: 06-03-2009, 09:49 AM
  3. Is GUI same like Visual Basic ?
    By Caesar in forum Software Development
    Replies: 2
    Last Post: 02-03-2009, 01:32 PM
  4. Visual Basic 2005 or Visual Basic 6
    By Aasha in forum Software Development
    Replies: 5
    Last Post: 15-01-2009, 06:56 PM
  5. Visual Basic on LAN
    By djbbenn in forum Software Development
    Replies: 2
    Last Post: 05-08-2008, 02:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,044,305.81469 seconds with 17 queries