views:

23

answers:

3

I have ScrollableControl inheritor and i want to draw elements (like header) which are not scrollable during scrolling.

Is there any solution?

A: 

you must calculate with AutoscrollOffset property in your layoutlogic.

Jack
I have no child controls. I'm just drawing on control surface. And if i scroll down it redraws only new area apreared in the bottom, even if i do e.Graphics.SetClip to my header.
silly_dg
A: 

It seems there is no way to do that. When control is scrolled up for example, all content scrolled (copied) by ScrollWindow API call, and the rest part of control is invalidated.

All other hacks like handling scroll events and drawing over the control surface are not suitable.

silly_dg
A: 

I had the same problem. I tried overriding the OnScroll event to invalidate a "fixed top-bar", but the results are jaggy and unsatisfactory.

In the end, I opted for a panel child-control on top of the scrollable region.

Zenzer