Click to See Complete Forum and Search --> : Properties not showing in V.S. Property Browser
plnelson
May 21st, 2009, 05:07 PM
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 . . .
private float specularity;
[Category("Appearance")]
[Browsable(true)]
[Description("Sets shininess of button")]
public float Specularity
{
get
{
return specularity;
}
set
{
specularity = value;
}
}
Thanks in advance!
plnelson
May 21st, 2009, 10:33 PM
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.
JonnyPoet
May 24th, 2009, 05:12 PM
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.
BigEd781
May 24th, 2009, 05:15 PM
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).
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.