Solved

Custom User Control Repaint Problem in Designer View

Posted on 2007-03-30
2
283 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
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.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

785 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