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
I need to create a custom control containing a combobox whose popup will have
I have a UIBarButtonItem containing a button, on which I've set custom background images
I have a custom control containing a ListView control, which displays files in the
I have a custom control containing a path that has a templated tooltip. I
I have a DataGrid in a Silverlight control which contains custom controls. These custom
I have custom server control contains templatefield when an out button clicked the field
I have a custom control which displays results of some operations. It is hidden
I have a custom control with a public collection marked as DesignerSerializationVisibility.Content . When
I have a Custom Control that has multiple textbox fields and a checkbox contained

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.