bwells Posted March 21, 2003 Posted March 21, 2003 (edited) In my MDI app, when the user shrinks an MDI child form so scroll bars appear, then the uesr then drags the vertical scroll bar down, the contents of the form seem to get partially redrawn so they appear to stretch down. When the user stops the drag of the scrollbar, then the form draws itself and it looks fine. What would cause the controls to not get re-drawn correctly on a scroll event? I am not listening or processing the scroll event, and I would expect the contents of the form to move smoothly on a scrollbar drag as if it is larger than the container. But instead it looks like the form/contols are being drawn as the scrollbar is being dragged. Any thoughts on how to make the scrolling look smooth? thanks Bryan Edited March 21, 2003 by bwells Quote
a_jam_sandwich Posted March 21, 2003 Posted March 21, 2003 In the on Scroll (VScoll) I think even just tell the for to refresh Or form.invalidate() Sorts it self out but this make scrolling slower Quote Code today gone tomorrow!
bwells Posted March 22, 2003 Author Posted March 22, 2003 I am having trouble finding any way to register for scroll events. I set the autoscroll property to true, but otherwise, there does not seem to be a delegate for scroll events on a Form. Can you be more specific? Quote
*Gurus* divil Posted March 22, 2003 *Gurus* Posted March 22, 2003 I've never tried doing this, but you could try overriding OnLayout. I guess that would be called when the user scrolls, amongst other things. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
bwells Posted March 22, 2003 Author Posted March 22, 2003 I tired the OnLayout but it did not get called when I scrolled, only when I resized the dialog. Can you think of a reason why my controls would appear smeared istead of smoothly scrolling? I am sure I have done something to cause this. Perhaps it is a function of the panel containing the controls. I am running an animation in some windows, but the CPU usage is low. Quote
*Gurus* divil Posted March 22, 2003 *Gurus* Posted March 22, 2003 No, I can't think of a reason why that would happen if your drawing code is correct. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.