Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Custom User Control Repaint Problem in Designer View

Posted on 2007-03-30
2
284 Views
Last Modified: 2008-01-09
I'm making a custom user control where I override the paint function and do my own drawing... When I change properties of the control (Color, etc...), it doesn't repaint.  I have to actually close the designer form and reopen it to see the changes...

I tried this...

private Color m_BackgroundColor = Color.White;
public Color BackgroundColor
{
      get
      {
            return m_BackgroundColor;
      }
      set
      {
            m_BackgroundColor = value;
            Invalidate();
      }
}


But this doesn't appear to be working to redraw in designer mode.

Any suggestions?


0
Comment
Question by:collages
2 Comments
 
LVL 2

Accepted Solution

by:
ironwill96 earned 500 total points
ID: 18886455
Apparently to change how it works in design time you have to write a custom designer as well.

See references here: http://msdn.microsoft.com/msdnmag/issues/04/12/CustomFormsDesigner/default.aspx
and here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/custdsgnrdotnet.asp

Hope that helps some.  Seems like a pain but I guess the default design behavior is just generated from what is exposed but doesnt do anything fancy.

0
 
LVL 1

Author Comment

by:collages
ID: 19009310
Excellent answer.  Thank you!
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question