Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Gah! The designer is filling in my properties for me!!
 

Gah! The designer is filling in my properties for me!!

So I've got this color picker that I've made that is derrived from a panel. It's got public properties called: Hue, Saturation, and Value.

My issue is that before these values can be set, my color picker has to have the Init() function called before any of these properties are set. The designer is automatically generating code to set Hue, Saturation, and Value to 0 obviously before my Init() function gets called, so it's crashing.

How can I make it so that the designer doesn't try to set these properties?
MrBones  Wednesday, September 19, 2007 8:26 PM

I think the designer is filling your properties with default values whenever required.

Can't you just ignore any value feed to your control properties before the Init() is called?

Code Snippet

public int Hue

{

set {

_myHue = _defaultHue;

if (init) _myHue = value;

}

get { return _myHue; }

}

Yours,

Agustin Garzon

TheAgus  Wednesday, September 19, 2007 11:11 PM
That's actually what I'm doing as a work around. I'm mostly just wondering why the designer is trying to set these values and how I can avoid it from happening for things in the future.
MrBones  Thursday, September 20, 2007 1:40 AM

You can use google to search for other answers

Custom Search

More Threads

• How to modify TaskBar Menu of a Program
• Tooltip blocks control properties!
• Form Blew Up??!
• Scrolling user control
• How do you disable the Up/Down arrow in PropertyGrid collection editor
• Custom Button not showing up in Designer
• Dragging ActiveX Control in the Designer Area which needs a License Key
• User control resizing abnormal behavior
• VS Designer Removing Control.Add declarations
• Laying out my form, equivelant to BorderLayout.