UserControl on inherited form
- From: "Sebastian Bargmann" <seb@xxxxxxx>
- Date: Fri, 5 Aug 2005 11:39:50 +0200
Hi,
I'm having a mysterious problem in the designer. I have created a simple
usercontrol, which apparantly works fine except when placed on a inherited
form in the designer.
I drop the control on the form. Change one of the properties in the designer
(a color-setting in this case) and hit "build". The property then reverts to
its default value (defined in the constructor).
For some reason, when using an inherited form, the usercontrol's ctor is
called when I hit "build". But the designer fails to either save/load the
new value before/after doing so.
I'm guessing that I'm missing some vital attribute somewhere - relevant code
sections below:
<code>
public class Bevel : System.Windows.Forms.UserControl
{
private Color highlightColor;
[...]
public Bevel()
{
InitializeComponent();
highlightColor = SystemColors.ControlLightLight;
[...]
}
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
[Category("Appearance")]
[Description ("Highlight color")]
[DefaultValue(typeof(Color), "ControlLightLight")]
public Color HighlightColor
{
get
{
return highlightColor;
}
set
{
highlightColor = value;
Invalidate();
}
}
[...]
}
</code>
Any clues?
Thanks,
Sebastian
.
- Follow-Ups:
- Re: UserControl on inherited form
- From: Allen Anderson
- Re: UserControl on inherited form
- Prev by Date: RE: Visual designer not setting values of custom control propertie
- Next by Date: Disable desginers for sited child controls (VS.NET 2005)
- Previous by thread: Using CodeDom and IDesignerSerializationManager
- Next by thread: Re: UserControl on inherited form
- Index(es):
Relevant Pages
|