AutoScroll Form Redraw Bug

Sapporo

Newcomer
Joined
Feb 10, 2003
Messages
7
I just came across a rather annoying bug (VB.NET) that has to deal with the autoscroll feature on forms.

How to reproduce the bug:

1. Create a form
2. Add any control (I used button)
3. Add any control (I used a textbox set to multi-line)
4. Set the Form.AutoScroll = True
5. Resize the form in the design view so that it will cut the second control in half. The scrollbar should now be visible.
6. Ensure that the first control will have focus when the form loads (tabindex = 0)
7. Run the project. You should see that the first control has focus and the second control does not get drawn at all. It will literally be a screen artifact of what is under the form.

The 2nd control will not be drawn even if you maximize the form or resize it. You have to invalidate the entire form for the control to be drawn (like minimize and restore, or move a dif app window over it).

Any suggestions on how to fix this?
 
Back
Top