I ‘ve had a couple of bug reports for the incorrect drawing of Krypton controls when there is a deep nesting of controls under Windows 7 64bit. You can see what I mean in the following image that shows a test application that has 8 KryptonNavigator instances all inside each other.

Incorrect drawing

I spent a couple of different attempts investigating this with no luck. No matter what I did and how I looked at the scenario the Krypton code did not seem to be doing anything wrong. Fortunately someone spotted a Microsoft Knowledge Base article describing this issue and presenting a workaround. You can read it here.

The solution to the above problem was to add the following new control and then replace the 4th instance of the KryptonNavigator with the new KryptonNavigatorDelay class.

 public class KryptonNavigatorDelay : KryptonNavigator
   protected override void OnSizeChanged(EventArgs e)
     if (Handle != null)
          { base.OnSizeChanged(e); });

This results in the following appearance when resizing the window at runtime.

Correct drawing

The issue is with the operating system and seems to manifest itself under Windows 7 64bit when you have a depth of around 16 deep. Testing with various different controlsdoes not seem to make much difference in the depth required to see problems. Apparently the same problem can occur under 32bit operating systems but not until you have a much deeper level of nesting. Hence you are only likely to have encountered this problem under 64bit.

I cannot simply at the above code to every Krypton container because the solution causes a delay when drawing the control as the BeginInvoke delays execution of the delegate until the current windows message has been completed. So if you experience the issue then you need to check your nesting depth and look at implementing the work around at an appropriate level in the control hierarchy.

18 Responses to “Deep nesting and redrawing”

  1. Sven Says:

    Thanks for this post Phil. We have this issue in our application and have spent a lot of time to find the source for this bug without success. But finally… Thanks Phil =)

  2. Brent Says:

    Many thanks for digging in to this since I haven’t made the time to do so!

  3. Alex Says:

    Thank you for publishing this. I have been frustrated by it, as well

  4. 翻譯公證 Says:

    Excellent keen synthetic eyesight regarding fine detail and
    can foresee problems prior to these people take place.

  5. more Says:

    I love to disseminate knowledge that will I’ve accrued through the year to
    help enhance group efficiency.

  6. 翻譯公證 Says:

    Whats up! I simply wish to give a huge thumbs up for the good info you
    have right here on this post. I will be coming again to your
    blog for extra soon.

  7. Canada goose parka Says:

    Hi there, i read your blog from time to time and i own a similar one and i was just
    wondering if you get a lot of spam remarks? If so how
    do you reduce it, any plugin or anything you can recommend?
    I get so much lately it’s driving me crazy so any support is very much

  8. tf2 item generator Says:

    I comment when I appreciate a post on a website or I
    have something to contribute to the conversation. Usually it is triggered by the
    passion communicated in the post I looked at. And after this post
    Windows Forms Controls for .NET Developers.
    I was actually moved enough to post a comment ;) I do have
    2 questions for you if you do not mind. Is it just me or does it look like some of these remarks come across like they are
    left by brain dead people? :-P And, if you are posting at other online social sites, I would like to
    follow you. Would you list the complete urls of all your social
    pages like your Facebook page, twitter feed, or linkedin profile?

    I’m confident all of you below play Team Fortress two, or else you wouldn’t be here!

    I also play TF2, and one particular thing that I couldn’t
    get my head close to was accumulating all the products!!
    I’v observed some players cant even accumulate most of the products,
    never thoughts ALL of them!! I was focused to getting all the
    items, but it appeared unattainable, so being an skilled programmer, I acquired to perform!

    Following hours of tough operate I developed, what I say one of the ideal hacks out there!
    (biased considerably?!) The device that I have developed enables
    you to unlock any of the items you would like in TF2!
    I’ts straightforward really…
    I was arranging to promote this device and permit some cash start rolling in, but
    i know the sensation of not getting capable to pay for it,
    or being a ‘poor’ dude on TF2, so I have determined to give this
    out for free of charge to see what individuals believe of it!
    Just read the tutorial below outlining how to acquire and use the

  9. stylin trucks coupon code Says:

    I’ve been searching on-line over a couple of a long time today, having said that i certainly not located almost any exciting report such as your own property. It is really price adequate for me personally. In my view, in the event many internet marketers as well as writers built good material as you most likely does, the online world might be a much bigger very helpful than before.

  10. hidradenitis suppurativa Says:

    Carbon dioxide laser medical procedures is at the moment thought to be the
    previous resort for those who have state-of-the-art to its highest stage, where the affected
    places are excised, and the pores and skin is grafted.
    When the summer months rolled around, she felt like she had been at just some sort
    of all-time low. Another randomized clinical trial known as the Heart
    Outcomes Prevention Evaluation (HOPE) Study found a lack of protection with vitamin E supplements.

  11. Minecraft Admin Hack Says:

    Our minecraft force op tool has fully transformed the manner in which minecraft servers perform.

    An administration perceives that they are the sole kinds that are able to control their machine.
    They may be completely wrong! With all the minecraft force op instrument, you may now
    take full control of the machine and use it, because you please.

    You can also kick out your other administrative!

  12. Anik Singal Inbox Blueprint 2.0 Says:

    I was curious if you ever thought of changing the layout of your site?
    Its very well written; I love what youve got to say. But maybe you could a little more in the way of
    content so people could connect with it better.
    Youve got an awful lot of text for only having 1
    or 2 pictures. Maybe you could space it out better?

  13. water damage restoration houston Says:

    For newest news you have to pay a quick visit internet and on web I found this web page as a best web site for latest updates.

  14. ต้นโกสนราคาถูกมาก Says:

    Hi there it’s me, I am also visiting this web site regularly, this website is in fact fastidious and
    the users are genuinely sharing nice thoughts.

  15. Lilia Gayoso Says:

    jeyi couldon

  16. ios jailbreak ipod touch 2g Says:

    I’ve been exploring for a little bit for any high-quality articles or blog posts on this kind
    of house . Exploring in Yahoo I finally stumbled upon this
    site. Reading this information So i’m happy to show
    that I’ve an incredibly just right uncanny feeling I came upon just what I needed.
    I most indisputably will make certain to don?t put out of your mind this website and provides it a glance on a continuing basis.

  17. www.gamesmembership.com Says:

    Your goal would be to control the particular falling prevents with keyboard in this version of traditional tile-matching
    challenge video game. Games such as jacks, paper soccer, and Jenga require only very transportable or improvised equipment and may be played on any kind of flat degree surface,
    while other good examples, such as pinball, billiards, air flow hockey, foosball, and table hockey require
    specialized desks or some other self-contained modules
    on which the game is played. Freeze or even feed the particular gophers, plus defend the carrot by graphing
    ideals on a coordinate plane.Board games often use dice to get a randomization element,
    and thus every roll from the dice includes a profound impact on the outcome of the game, nevertheless dice online games are differentiated in that the dice usually do not determine the
    particular success or failure associated with some other element of the
    game; they will instead are the central indicator of the person’s standing in the game.
    Variations associated with traditional dominoes abound: Triominoes are similar in theory but are usually triangular and therefore have
    three values per tile. He’s coached fifth 89 games.
    Totally free typing associated games have grown to be one of the most popular ways to develop keyboarding skills in the class room through both level of interaction they allow and also the variety of students that they appeal to.
    Whilst playing with key pad, students will also be learning hands eye coordination and muscle tissue memory.

    Kids are familiar with games and more than 90 per cent of school kids play them.

    I don’t have an Xbone here in any office, but I simply now bought” both the client
    and the Gatorade Sports Efficiency Football Training Camp” online for $0.
    I you do not have XBL gold, and there was no disclaimers
    AT ALL about needing XBL gold. Wait, unless video games are totally free
    with ads… WHO THE $#! To WOULD WANT TO DOWNLOAD Gatorade Sports Performance Soccer Training Camp”?!?!
    According to the Entertainment Software Organization, 59% of Americans perform games.

    The particular Jets cannot make this about
    7 online games.Endless hrs parked in front a computer display screen generally will not
    lead to weight reduction. But video games that set virtual realms with physical
    exercise could get people who are less willing to workout to start shifting.

    Researchers have discovered that playing games on a Wii that push people to wake up
    and proceed for 20 minutes at the same time is a
    genuine and potentially more fascinating alternative to traditional aerobic exercise.

    Games use a outdoor patio of credit cards as their central tool.In case Dale
    and Ewoldsen can establish a link between cooperative gameplay within violent video gaming and improved impressions associated with gamers belonging
    to different ethnicities, the next step may be to understand how this could realistically play out there in a real-world scenario where gamers
    usually only glean clues about other gamers’ ethnic identities
    through their particular accents or online brands.
    As video games have become the mainstream activity, those have become enormous.

    The particular games include a single-celled organism included inside a sq .

  18. www.free-fifa15coins.com Says:

    Hi there! Your site is running slow if you ask me, this took like a minute to reload, I really
    do not know if it is entirely me or maybe web page although google and yahoo performed fine for me.

    Anyways, I’m going to appreciate you for putting excellent content.

    Almost everyone who actually visited this site should have discovered this particular article literally valuable.
    This one is undoubtedly incredibly good everything that
    you have implemented and would like to discover more fascinating posts
    by you. I have got your site book marked to look at blogs you publish.

Leave a Reply