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. C#
  4. ComboBox container

ComboBox container

Scheduled Pinned Locked Moved C#
dockerhelpquestion
3 Posts 2 Posters 0 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.
  • D Offline
    D Offline
    DougW48
    wrote on last edited by
    #1

    I declare a ComboBox in a class. The box never actually shows up on a form, but the variable for the box exists, and is initialized. What is confusing me is that I tried setting the datasource and valuemember of this combo box to a table in a dataset, but nothing is being put into the list of my combobox. I'm pretty confused, so some advice or suggestions would help. Thanks! ;)

    H 1 Reply Last reply
    0
    • D DougW48

      I declare a ComboBox in a class. The box never actually shows up on a form, but the variable for the box exists, and is initialized. What is confusing me is that I tried setting the datasource and valuemember of this combo box to a table in a dataset, but nothing is being put into the list of my combobox. I'm pretty confused, so some advice or suggestions would help. Thanks! ;)

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      It doesn't matter if you declare a variable or not, you must add it to the parent control's Controls collection property, just like all the other controls. Expand the "Windows Form Designer generated code" region and look at the InitializeComponent method that the designer code serializer uses for examples, and see the Control.Controls property documentation in the .NET Framework SDK.

      Microsoft MVP, Visual C# My Articles

      D 1 Reply Last reply
      0
      • H Heath Stewart

        It doesn't matter if you declare a variable or not, you must add it to the parent control's Controls collection property, just like all the other controls. Expand the "Windows Form Designer generated code" region and look at the InitializeComponent method that the designer code serializer uses for examples, and see the Control.Controls property documentation in the .NET Framework SDK.

        Microsoft MVP, Visual C# My Articles

        D Offline
        D Offline
        DougW48
        wrote on last edited by
        #3

        Excellent help as always. Thanks Heath, worked perfectly. :-D

        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