show properties of a control in property window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thanh-Nhan Le

    show properties of a control in property window

    Hi,
    I am writing a control myTextbox (simply a new class, which inherits class TextBox).
    myTextbox class has property DataControlTyp, which is a enumeration: Now when I select this control in design window, I want to see this property as a list (combobox) in property window, to set a value to it.

    How can I do it? Following is my code.

    Thanks
    Nhan
    public enum enumDataControl Typ : short

    {

    DataControlTyp_ Yes = -1,

    DataControlTyp_ None = 0,

    DataControlTyp_ Yes_xxx = 1

    }

    public class myTextbox : System.Windows. Forms.TextBox

    {

    protected enumDataControl Typ m_tDataControlT yp = enumDataControl Typ.DataControl Typ_Yes_xxx;

    public enumDataControl Typ DataControlTyp

    {
    get { return m_tDataControlT yp; }

    set { m_tDataControlT yp = value; }
    }

    }

  • Marc Gravell

    #2
    Re: show properties of a control in property window

    That should be all you have to do. Try reloading VS if it isn't
    appearing...

    Marc

    Comment

    • Thanh-Nhan Le

      #3
      Re: show properties of a control in property window

      No, I cannot see it. I have also property DataField in the class, it appears
      in the prop window. The prop DataControlTyp is not to see.

      public string DataField

      {
      get { return m_sDataField; }
      set { m_sDataField = value; }

      }



      "Marc Gravell" <marc.gravell@g mail.comwrote in message
      news:15ab0fdf-aa7f-4dda-a5b7-9a961b8d2c65@z2 6g2000pre.googl egroups.com...
      That should be all you have to do. Try reloading VS if it isn't
      appearing...
      >
      Marc

      Comment

      • Thanh-Nhan Le

        #4
        Re: show properties of a control in property window

        OK, now I have it.
        My myTextbox inherrits from a abstract class, which inherits form the class
        Textbox.
        It can be, that I must restart my computer :-) ?

        But now I can see it. Thanks


        "Marc Gravell" <marc.gravell@g mail.comwrote in message
        news:15ab0fdf-aa7f-4dda-a5b7-9a961b8d2c65@z2 6g2000pre.googl egroups.com...
        That should be all you have to do. Try reloading VS if it isn't
        appearing...
        >
        Marc

        Comment

        Working...