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!
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.
Re: Properties not showing in V.S. Property Browser
Quote:
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.
Re: Properties not showing in V.S. Property Browser
Quote:
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).