Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4052988
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:23:22+00:00 2026-05-20T14:23:22+00:00

I have a custom control containing a mixture of custom and standard controls. When

  • 0

I have a custom control containing a mixture of custom and standard controls. When the control is made larger, I’m getting background coloured rectangles where the child control will be painted, before the paint of the child control completes. It’s the same for both my custom controls and the standard ones.

I thought that suspend layout was the way to avoid this, but it isn’t working for me.

I suspend layout for the container and all its controls while the resizing takes place.

Do I need to override the paint method for the child controls? Surely that would mean new custom controls to replace all the standard ones, or do I need to override the paint method for the container?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:23:23+00:00Added an answer on May 20, 2026 at 2:23 pm

    EDITED to correct information and reference

    One approach is to double buffer. People often set this style and assume it is working but you may not in fact get double buffering for various reasons. But true double buffering can have some negative consequences too.

    The following solution provide by Hans Passant will typically fix this sort of problem without causing some of the side effects of double buffering.

    label backgrond flicking on a WinForms user control has background image enabled

    By removing the WS_CLIPCHILDREN attribute the spaces the controls are supposed to occupy will be filled with background first which can reduce the artifacts you see waiting for the controls to be drawn

    Add the following code to your custom control:

    protected override CreateParams CreateParams
        {
            get
            {
                CreateParams parms = base.CreateParams;
                parms.Style &= ~0x02000000;  // Turn off WS_CLIPCHILDREN
                return parms;
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After I have changed my dll containing my custom control I am getting warnings
In general, I am wondering when to use custom controls vs integrating the control
I have custom control where i want to show some items. In generic.xaml defined
I have custom control - chart with size, for example, 300x300 pixels and more
I have a 3rd party control that is quite complex and takes some time
I have Telerik RadGrid with a custom edit form. In my edit form there
I'm trying to match my application's custom controls colors to the ones used in
I need to move controls around when the scrollbar's size change ( System.Windows.Forms.SystemInformation.VerticalScrollBarWidth ).
I have a WinForms application in which I want to be able to provide
I have to upgrade one existing application and neeed to split its existing UI

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.