开发者

SetScrollRange Function

I've read about SetScrollRange but still didn't get what the range (min, max) is in scrollbar. I've set the rich edit control's vertical scroll bar range to (0, 100)

SetScrollRange(hwndRichEditControl, SB_VERT, 0, 100, TRUE);

Now, If I try GetScrollPos to get the position i'm getting the value over max range. Shouldn't the position be between 0 and 100?

int Pos = GetScrollPos(hwndRichEditContr开发者_开发技巧ol, SB_VERT);


It shouldn't. The RichEdit control itself determines the scroll range of the scroll bar. Which it does depending on how much text it displays. Overriding it isn't going to last long, if at all. You can only use GetScrollInfo() to find out what it is using currently. This is going to change as soon as the user adds text.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜