I have an edit box that was created with CreateWindow() and is a child to another window. The styles that I used were:
WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL |ES_AUTOVSCROLL | ES_LEFT | ES_MULTILINE |ES_NOHIDESEL | WS_VSCROLL | WS_HSCROLL | WS_BORDER | ES_WANTRETURN
I want to hide the scroll bars to the edit box when they are not needed. I understand that I can use the ShowScrollBar() to hide and unhide them, but how do i tell if a scroll bar is needed or not? I searched msdn for a message that is sent when an edit box scrolls automatically when a line exceeds the size of the edit box but found nothing. I only found messages that are sent when the user clicks on a scroll bar etc.
I believe if you make the upper range of the scrollbars movement equal to the lower range, the scrollbar dissappears. It is still there but temporarily removed while the view fits inside the window.
Yes, but how do I tell if the scroll bar is needed or not. I need a way to tell if the text fits it the edit window or not. I thought about doing this by getting the length of the lines and seeing if they are too long for the edit boxes current size, but that seems like a lot of work.