Results 1 to 11 of 11

Thread: Question about the ComboBox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    112

    Question about the ComboBox

    Hello All!

    How can I create a ComboBox that it got only the below values:

    OFF
    -10
    -15
    -20
    -25
    -30
    -35
    -40
    -45

    And the user cant enter another value.
    Thanks !
    Y

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Question about the ComboBox

    Code:
    Private Sub Form_Load()
    Combo1.AddItem "item1"
    Combo1.AddItem "item2"
    Combo1.AddItem "item3"
    'etc...
    End Sub
    By setting the Combox's Style property to Dropdownlist, it will allow users to only select the item...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    112

    Re: Question about the ComboBox

    Thanks!

    But still the user can type a value that he wants...
    Can I disable the option to write in the ComboBox?

    Thanks Again!
    Y

  4. #4
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Question about the ComboBox

    Can I disable the option to write in the ComboBox?
    By setting the Combox's Style property to Dropdownlist

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Question about the ComboBox

    And, even if the user types something different it will not be made a member of the combo box unless you, the programmer, add it through code.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    112

    Re: Question about the ComboBox

    Thanks!

    Another question,
    How can I make that the first item in the list will appear at running?

    Thanks!
    Y

  7. #7
    Hyperactive Member jp26198926's Avatar
    Join Date
    Sep 2008
    Location
    General Santos City, Philippines
    Posts
    310

    Re: Question about the ComboBox

    Quote Originally Posted by li9erYol View Post
    Thanks!

    Another question,
    How can I make that the first item in the list will appear at running?

    Thanks!
    Y
    Combo1.ListIndex = 0
    "More Heads are Better than One"

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    112

    Re: Question about the ComboBox

    Thanks!

    And how can I make that the second item in the list will appear at running?

  9. #9
    Hyperactive Member jp26198926's Avatar
    Join Date
    Sep 2008
    Location
    General Santos City, Philippines
    Posts
    310

    Re: Question about the ComboBox

    Quote Originally Posted by li9erYol View Post
    Thanks!

    And how can I make that the second item in the list will appear at running?
    Combo1.ListIndex = 1
    "More Heads are Better than One"

  10. #10
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Question about the ComboBox

    Code:
    Combo1.ListIndex = 1

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    112

    Re: Question about the ComboBox

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width