Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Custom User Control Repaint Problem in Designer View

Posted on 2007-03-30
2
Medium Priority
?
290 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
[X]
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
2 Comments
 
LVL 2

Accepted Solution

by:
ironwill96 earned 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

715 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