user control properties

  • Thread starter Thread starter David
  • Start date Start date
D

David

hello...
i writen my user control, but how can i make it to remember its properties,
assigned during design time whru real time...

lets say i have property, BackColor, user set's it in a design time...
i want it to be the same in the real time...

tnx...
 
David,

If you expose a proeprty like BackColor, then in the designer, the IDE
will write the code that will set the property to whatever the user selects
in the property browser. The responsibility of serializing the values
between instance is not the responsibility of the control.

You might want to check out the following links on creating designers
and enhancing the design-time experience (watch for line wrap):

http://msdn.microsoft.com/msdnmag/issues/03/04/design-timecontrols/

http://msdn.microsoft.com/msdnmag/issues/03/05/design-timecontrols/

Hope this helps.
 
Hi David,

Try to set the following custom attributes to your property

[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Color BackColor
{
....
}
 
Back
Top