What is the purpose of suspend and resume layout? i cant see it working
-
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
-
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
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] }
-
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] }