|
동동0 님이 쓰신 글 :
: 스크롤바가 Min=0, Max=100 이고 현재 그림을 스크롤 가능하게 보여주고 있습니다.
: 그림 보이는 부분 Height=30 이라면 PageSize를 얼마로 해야지
:
: Height / Max == 스크롤바 막대 길이 / 스크롤바 막대 이동 가능 범위 길이
:
: 의 비율이 유지될까요?
:
: 즉, 스크롤바 막대 길이를 화면이 전체 영역에 대해 차지하는 비율만큼으로 해줄 수 있을까요?
시간이 남아서 원하시는 것을 파악하지 못했습니다.
참고할 만한 소스를 드리지요!
빌더 도움말에 보여 아래와 같은 코드가 나오는데 참고하시고요.
// Get the minimum (default) size of the thumb tab
int MinHeight = GetSystemMetrics(SM_CYVTHUMB);
// Get the size of the scrollbar track
int TrackHeight = ScrollBar1->ClientHeight ?2*GetSystemMetrics(SM_CYVSCROLL);
// set PageSize to represent the visible portion of the scrolling range:
ScrollBar1->PageSize = TrackHeight/(ScrollBar1->Max ?ScrollBar1->Min + 1);
// Don뭪 let the thumb tab get too small
if (ScrollBar1->PageSize < MinHeight)
ScrollBar1->PageSize = MinHeight;
|