Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. VB.NET comboBox help !!

VB.NET comboBox help !!

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasehelptutorial
4 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Saam_cse
    wrote on last edited by
    #1

    In my windows form there are few comboBox.They are bind with database. But when I run the form and select any comboBox and backspace or press delete button then comboBox delete.But I don't like so. How to avoid this.I like to behave comboBox like webpage. Such as when I click in any comboBox item name(not in black triangle-arrow), comboBox should open the item list.

    D V L 3 Replies Last reply
    0
    • S Saam_cse

      In my windows form there are few comboBox.They are bind with database. But when I run the form and select any comboBox and backspace or press delete button then comboBox delete.But I don't like so. How to avoid this.I like to behave comboBox like webpage. Such as when I click in any comboBox item name(not in black triangle-arrow), comboBox should open the item list.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Saam_cse wrote:

      But when I run the form and select any comboBox and backspace or press delete button then comboBox delete.

      If the combobox is being removed from the form, you're still in the designer, not the running application. You cannot just click on a control and delete it unless you provide the code to do so.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      1 Reply Last reply
      0
      • S Saam_cse

        In my windows form there are few comboBox.They are bind with database. But when I run the form and select any comboBox and backspace or press delete button then comboBox delete.But I don't like so. How to avoid this.I like to behave comboBox like webpage. Such as when I click in any comboBox item name(not in black triangle-arrow), comboBox should open the item list.

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        ok see this, the items on the Combobox will not be edited.

        comboBox1.Items.Add("First");
        comboBox1.Items.Add("Second");
        comboBox1.Items.Add("Third");
        comboBox1.Items.Add("Forth");
        comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;

        Hope this is what you want

        Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

        1 Reply Last reply
        0
        • S Saam_cse

          In my windows form there are few comboBox.They are bind with database. But when I run the form and select any comboBox and backspace or press delete button then comboBox delete.But I don't like so. How to avoid this.I like to behave comboBox like webpage. Such as when I click in any comboBox item name(not in black triangle-arrow), comboBox should open the item list.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Set its DropDownStyle property to DropDownList.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups