how to draw nonscrollable elements on ScrollableControl
-
04-10-2019 - |
문제
I have ScrollableControl inheritor and i want to draw elements (like header) which are not scrollable during scrolling.
Is there any solution?
해결책
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.
다른 팁
you must calculate with AutoscrollOffset property in your layoutlogic.
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.
제휴하지 않습니다 StackOverflow