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. How can I list the enumeration items in a combo box?

How can I list the enumeration items in a combo box?

Scheduled Pinned Locked Moved C#
questiontutorial
4 Posts 3 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.
  • B Offline
    B Offline
    bouli
    wrote on last edited by
    #1

    Hi gurus, I would like to know how it is possible to insert in a combo box the text values of an enumeration object? For example, consider the SymbolType enum object from ZedGraph. I would like to browse the enumeration values and add them in a combo box in order to give to the user the possibility to select the symbol for the curve. I hope my question is clear enough. Best regards. Fred.

    There is no spoon.

    G S 2 Replies Last reply
    0
    • B bouli

      Hi gurus, I would like to know how it is possible to insert in a combo box the text values of an enumeration object? For example, consider the SymbolType enum object from ZedGraph. I would like to browse the enumeration values and add them in a combo box in order to give to the user the possibility to select the symbol for the curve. I hope my question is clear enough. Best regards. Fred.

      There is no spoon.

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Use Enum.GetNames(typeof(SymbolType)) to get the names of the constants.

      Despite everything, the person most likely to be fooling you next is yourself.

      B 1 Reply Last reply
      0
      • G Guffa

        Use Enum.GetNames(typeof(SymbolType)) to get the names of the constants.

        Despite everything, the person most likely to be fooling you next is yourself.

        B Offline
        B Offline
        bouli
        wrote on last edited by
        #3

        Ok that works great :) Thanks! :-D

        There is no spoon.

        1 Reply Last reply
        0
        • B bouli

          Hi gurus, I would like to know how it is possible to insert in a combo box the text values of an enumeration object? For example, consider the SymbolType enum object from ZedGraph. I would like to browse the enumeration values and add them in a combo box in order to give to the user the possibility to select the symbol for the curve. I hope my question is clear enough. Best regards. Fred.

          There is no spoon.

          S Offline
          S Offline
          Scott Dorman
          wrote on last edited by
          #4

          Check out this article[^].

          Scott Dorman

          Microsoft® MVP - Visual C# | MCPD President - Tampa Bay IASA [Blog][Articles][Forum Guidelines]


          Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai

          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