|
-
May 21st, 2009, 05:07 PM
#1
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!
-
May 21st, 2009, 10:33 PM
#2
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.
-
May 24th, 2009, 05:12 PM
#3
Re: Properties not showing in V.S. Property Browser
 Originally Posted by plnelson
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
-
May 24th, 2009, 05:15 PM
#4
Re: Properties not showing in V.S. Property Browser
 Originally Posted by JonnyPoet
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|