I'm trying to do a control library. In my control library i have a class like that :
C# |
In my class i have 2 pcs of double variable.
These codes show MyCamera in PropertyPage in C# (desing time)
C# |
When i build solution i can see MyCamera in propery page but i can't see Distance and Far variables. I want to see as a treeview in property page. There should be + sign and when i press + sign , variables will shown.
How can i do this? Can someone help me.
Thanks in advance

Roei BarRank #1,271 · 1.4K reputationPosted Nov 19, 2009, 9:50 PM EST
First the Code is Incurrect here is te fixed one:
private Camera Camera_ ; public Camera MyCamera_ { get { if (Camera_ == null) Camera_ = new Camera(); return Camera_; } set { Camera_ = value; } }in order to access Camera properties just do the following :
Fatih13 reputationPosted Nov 19, 2009, 10:14 PM EST
I tested it but my problem is still available.
I put my Control Library on my Form. When i in "View Designer" mode, i can change some properties of my control in design time. But MyCamera properties look like a disabled and there is no my variables (Distance and Far). I can access by using code to MyCamera.
You can see in ss of my program.
Thanks in advance
Roei BarRank #1,271 · 1.4K reputationPosted Nov 20, 2009, 1:37 AM EST
Fatih13 reputationPosted Nov 20, 2009, 5:33 AM EST
Code is like that
public class Camera { public double Distance_; public double Far_; public Camera(double distance, double far) { Distance_ = distance; Far_ = far; } public double Distance { get { return Distance_; } set { Distance_ = value; } } public double Far { get { return Far_; } set { Far_ = value; } } } public partial class TestControlLib : UserControl { private Camera Camera_; public Camera MyCamera_ { get { if (Camera_ == null) { Camera_ = new Camera(100, 100); } return Camera_; } set { Camera_ = value; } } }I really want to thanx in advance one more time for your effort