CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2008
    Posts
    25

    Properties not showing in V.S. Property Browser

    I've been making an eye-candy (cool, shiny, glossy) button class derived from System.Windows.Forms.Button. It's in a DLL that I've added to the Toolbox so any application can use it easily. It works great, but I'm having trouble getting its new properties to show up in the Visual Studio Property Browser for applications that use it. What's the trick to doing this?

    here's a code snippet . . .

    Code:
           private float specularity;
    
            [Category("Appearance")]
            [Browsable(true)]
            [Description("Sets shininess of button")]
            public float Specularity
            {
                get
                {
                    return specularity;
                }
                set
                {
                    specularity = value;
                }
            }
    Thanks in advance!

  2. #2
    Join Date
    Dec 2008
    Posts
    25

    Re: Properties not showing in V.S. Property Browser

    I fixed my problem just now by starting over from scratch. My original class was made from a Visual Studio Control Library project. My new one was made from a Visual Studio class library project, which starts off very bare-bones so you have to code everything from scratch, but once I had the scaffolding up I could just copy and paste the code from my other button project and it's happy. If it's happy I'm happy so case closed.

  3. #3
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Properties not showing in V.S. Property Browser

    Quote Originally Posted by plnelson View Post
    I fixed my problem just now by starting over from scratch. My original class was made from a Visual Studio Control Library project. My new one was made from a Visual Studio class library project, which starts off very bare-bones so you have to code everything from scratch, but once I had the scaffolding up I could just copy and paste the code from my other button project and it's happy. If it's happy I'm happy so case closed.
    Maybe it would only have been necesssary to recoompile your dll after you added some properties and after it to dereferece the old version an reference the new one. Sometimes its enough to simple click to the reference of the dll after recompiling it, especially if you may see a small yellow triangle there.
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

  4. #4
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Properties not showing in V.S. Property Browser

    Quote Originally Posted by JonnyPoet View Post
    Maybe it would only have been necesssary to recoompile your dll after you added some properties and after it to dereferece the old version an reference the new one. Sometimes its enough to simple click to the reference of the dll after recompiling it, especially if you may see a small yellow triangle there.
    Yeah, sometimes when I add properties I have to restart VS before they appear. Remove and adding the reference once again would probably have the same affect (haven't tested that though).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured