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. Component Authoring

Component Authoring

Scheduled Pinned Locked Moved C#
help
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
    draco_iii
    wrote on last edited by
    #1

    While creating a web component I ran into a problem with setting the properties for the Designer Property Pages. One of my Properties can only be Top,Bottom,Left, or Right. I want these in a listbox on the property pages. I have hunted for a way to do this, but I have been unable to find anything remotely close to the subject.

    J 1 Reply Last reply
    0
    • D draco_iii

      While creating a web component I ran into a problem with setting the properties for the Designer Property Pages. One of my Properties can only be Top,Bottom,Left, or Right. I want these in a listbox on the property pages. I have hunted for a way to do this, but I have been unable to find anything remotely close to the subject.

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      draco_iii wrote: I want these in a listbox on the property pages. I have hunted for a way to do this, but I have been unable to find anything remotely close to the subject. All you should have to do is make sure your property is defined as an Enum then the property grid will take it from there.

      class MyClass
      {
      public enum Sides
      {
      Top, Bottom, Left, Right
      }

      private Sides sides;

      ....

      [Browsable(true)]
      public Sides Sides
      {
      get
      {
      return sides;
      }
      set
      {
      sides = value;
      }
      }

      ...
      }

      Maybe I just didn't understand the question, because it sounds like you have something similar to this already. James "It is self repeating, of unknown pattern" Data - Star Trek: The Next Generation

      D 1 Reply Last reply
      0
      • J James T Johnson

        draco_iii wrote: I want these in a listbox on the property pages. I have hunted for a way to do this, but I have been unable to find anything remotely close to the subject. All you should have to do is make sure your property is defined as an Enum then the property grid will take it from there.

        class MyClass
        {
        public enum Sides
        {
        Top, Bottom, Left, Right
        }

        private Sides sides;

        ....

        [Browsable(true)]
        public Sides Sides
        {
        get
        {
        return sides;
        }
        set
        {
        sides = value;
        }
        }

        ...
        }

        Maybe I just didn't understand the question, because it sounds like you have something similar to this already. James "It is self repeating, of unknown pattern" Data - Star Trek: The Next Generation

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

        I wanted to thank you so very much. That was right on target, I had something very similar, but was missing the "enum" contructions that allowed it to work properly. Again, thank you very much, I searched for hours yesterday, but to no avail.

        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