Drop down list box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dadasahebkhade
    New Member
    • Aug 2007
    • 1

    Drop down list box

    How to add item in Drop down list box?
    After selecting item from it , other field will show the fullfield data.

    Platform / OS / Version : Dot net / windows xp/1.1
    Language : Using c # dot net
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Dadasahebkhade. Welcome to TSDN!

    I'm going to go ahead and move this thread to the .NET forum, where our resident Experts will be better able to help you out.

    Comment

    • naivE
      New Member
      • Jun 2007
      • 12

      #3
      Hey, I am not really sure what you mean in the second part of your post but to add an entry to a listbox all you have to do is go -

      Code:
      listboxName.Items.Add("Your text here");
      Edit:

      Oh, and if you are wanting to get the value that was selected use something like this:

      Create a SelectedIndexCh anged event on the listbox then use

      Code:
      string entrySelected = (string)listBox1.SelectedItem;
      That will give you the string value that was selected by the user.

      Comment

      • naivE
        New Member
        • Jun 2007
        • 12

        #4
        Actually, it sounds a little bit like you are talking about a combo box. To insert a value into a combo box just type in:

        Code:
        comboBoxName.text.insert(indexNumber, textToBeInserted);
        Remember, the index number is zero based.

        Comment

        Working...