Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. What is the purpose of suspend and resume layout? i cant see it working

What is the purpose of suspend and resume layout? i cant see it working

Scheduled Pinned Locked Moved C#
tutorialquestioncareer
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sinosoidal
    wrote on last edited by
    #1

    Hi, For a long time that im trying to understand how resume/suspend layout works. I can't actually see any result of using those calls. I'm trying to avoid visual glitches caused for example by several repeated insertions in a treeview. but nothing happened. i also tried to used this calls when doing rezises to panels in realtime in order to avoid visual glitches as well. nothing happened... Can anyone give me a clear idea of how to use those calls? Thx, Nuno

    L 1 Reply Last reply
    0
    • S sinosoidal

      Hi, For a long time that im trying to understand how resume/suspend layout works. I can't actually see any result of using those calls. I'm trying to avoid visual glitches caused for example by several repeated insertions in a treeview. but nothing happened. i also tried to used this calls when doing rezises to panels in realtime in order to avoid visual glitches as well. nothing happened... Can anyone give me a clear idea of how to use those calls? Thx, Nuno

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, try this in the click handler of a button on your form, that has an empty but visible ListView named lv:

      lv.SuspendLayout();
      for (int i=0; i<100000; i++) {
      lv.Items.Add("item "+i);
      }
      lv.ResumeLayout();

      and try the same without Suspend/ResumeLayout; you wont need a stopwatch to experience the difference. :)

      Luc Pattyn


      try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }


      M 1 Reply Last reply
      0
      • L Luc Pattyn

        Hi, try this in the click handler of a button on your form, that has an empty but visible ListView named lv:

        lv.SuspendLayout();
        for (int i=0; i<100000; i++) {
        lv.Items.Add("item "+i);
        }
        lv.ResumeLayout();

        and try the same without Suspend/ResumeLayout; you wont need a stopwatch to experience the difference. :)

        Luc Pattyn


        try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }


        M Offline
        M Offline
        Martin 0
        wrote on last edited by
        #3

        Always great examples Luc! I really hope you make the MVP next time! Got my '5'!

        All the best, Martin

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups