How to suspend redrawing while changing e.g. column widths?

Posted by: jonasp on 8 September 2017, 2:52 pm EST

  • Posted 8 September 2017, 2:52 pm EST

    <p>I've got a bit of a problem which is causing some flickering.</p><p>At one point I save the column widths and at another point I restore the original column widths, starting from the leftmost column and then to the right.</p><p>Lets say that the user has resized the columns to </p><p>A: 50 px</p><p>B: 100 px</p><p>C: 100 px</p><p>And then I restore it to: </p><p>A: 100 px</p><p>B: 50 px</p><p>C: 50 px</p><p>The total width is the same and there shouldn't be any scroll bars displayed.</p><p>It's just that when I resize A the total width will be 100 + 100 + 100 and a scrollbar will appear. Then I proceed with resizing the other two columns and the scrollbar goes away. It's all giving a nasty flickering sensation.</p><p>I've tried doing a spread.SuspendLayout() and then resume when done but it still redraws while changing the individual column widths.</p><p>I even tried doing it the hard way and calling win32 SendMessage(spread, WindowMessage.WM_SETREDRAW, 0);  and then restoring redraw when finished but the spread still redraws while resizing the columns.</p><p>I got quite a lot of places where similar things are done and many of the spreads used has some flickering at some point caused by ditto operations. </p><p>How do I completely suspend the redrawing of the spread until I'm done resizing?  </p>
  • Replied 8 September 2017, 2:52 pm EST

    <p>you could set</p><p>fpSpread1.HorizontalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.Never;</p><p>then when you are done</p><p>fpSpread1.HorizontalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded;</p>
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels