views:

57

answers:

2
+1  Q: 

C# resizing issue

I have a form with a TableLayoutPanel docked to it, and with a textbox, image, treeview and listview within that panel.

When the user resizes the form, these controls resize with it, but there is a noticeable delay if the user resizes quickly or if the user maximizes the entire form; the delay is so considerable that I was able to screenshot it.

You can also notice that the "Options" button is displayed twice, once where it should be (on the upper right-hand corner) and once in the middle of the search box (where it was before the form resized). This isn't supposed to happen, but is also caused by the delay.

Shortly after this screenshot was taken, the form looked fine, but does anyone know of a way to eliminate or reduce this delay?

I edited the image for privacy reasons, but there were only 60 or so items in the listview.

+1  A: 

Go you have any special code handling the redrawing?

If so are you using the BeginUpdate() Method and the EndUpdate() method?

From msdn:"Prevents the control from drawing until the EndUpdate method is called."

These methods (depending on your situation) could cause the Components not to be updated until after the resize has occurred. This might stop the items appearing twice no the screen and speed up the resize.

TK
A: 

Maybe you have virtual items in your listview, and your items are recalculating slowly? Do you have any code that is running when listview need redraw?

Daniel Mošmondor