0

I m trying to customise the Horizontal scrollbar for a view in MFC edit control. and trying to set ScrollInfo to the same.

SCROLLINFO ScrollInfo;
   ScrollInfo.cbSize = sizeof(SCROLLINFO);
   ScrollInfo.fMask = SIF_PAGE | SIF_RANGE;
   ScrollInfo.nMin = 1;
   ScrollInfo.nMax = INT_MAX;
SetScrollInfo(SB_HORZ, &ScrollInfo, TRUE);

But the scrollbar is not setting up to the actual width of page.

Am I missing something.? I have attached the image also that shows the difference between the standard horizontal scrollbar and the customised horizontal scrollbar.

Example

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
  • Overriding `CEdit`'s scrollbar is not trivial, I don't think. Showing the declaration for `SCROLLINFO` does not explain anything. – Barmak Shemirani Dec 01 '17 at 18:00
  • You set the `SIF_PAGE` flag but you forgot to initialize `ScrollInfo.nPage`. – zett42 Dec 02 '17 at 00:46
  • Thank you.. for a vertical scroll bar i have set the ScrollInfo.nPage to the number of lines in the page. But i m confused for horizontal scroll bar as the width keeps varying. – Chetan Shetty Dec 04 '17 at 05:54

0 Answers0