Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Problem with BackColor of UserControl
 

Problem with BackColor of UserControl

Hi,

I've created a user control and want to use the BackColor property that is automatically created for the control. However, I can't figure out how to set a different default color for this property.

The default color automatically set for this property when I create a user control is 'Control'. But I want it to be 'Window'. The only way I know of setting the default is to override the property and use the Default attribute.But it appears that if I override the BackColor property (or ForeColor or Font, for that matter), I lose the automatic serialization when the property is set to a color other that the default (if I close the form and reopen it, it reverts back to the default). If I don't override it, the serialization happens automatically but thenI can't get the specificdefault color I want. I want to be able to set a specific default color AND have serialization.

So ... is there another way of setting the default for the BackColor property without overriding it? Or is there a way that when I override this property to force serialization?

Thanks in advance,

Greg

GregVance  Tuesday, February 26, 2008 6:58 AM

Never mind! Total and COMPLETE brain fart on my part.

Thanks,

Greg

GregVance  Tuesday, February 26, 2008 9:39 PM

Never mind! Total and COMPLETE brain fart on my part.

Thanks,

Greg

GregVance  Tuesday, February 26, 2008 9:39 PM

You can use google to search for other answers

Custom Search

More Threads

• Fonts not quite rendering the same between Design and Runtime
• Can I use a wizard without a form?
• GroupBox in a UserControl, redux
• Enabling / Disabling visibility of properties in property grid
• Need free .net (or C#) compression class for zip and cab
• Control like in debugger (mix of TreeView and ListView)
• ToolStripPanel loses design location of ToolStrips
• PropertyGrid
• Design Time Reflection
• Form Inheritance and Inheritance Picker problem