Scroll Bars

This is a discussion on Scroll Bars within the Windows Programming forums, part of the Platform Specific Boards category; I have an edit box that was created with CreateWindow() and is a child to another window. The styles that ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    30

    Question Scroll Bars

    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.
    Thx.

  2. #2
    not really here
    Guest
    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.

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    30
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Scroll Bars Are Scrolling Me Crazy
    By Iyouboushi in forum C# Programming
    Replies: 6
    Last Post: 03-03-2006, 12:43 PM
  2. Scroll bars
    By bigdan43 in forum C++ Programming
    Replies: 5
    Last Post: 04-19-2005, 12:05 PM
  3. Scroll bars.......
    By incognito in forum Windows Programming
    Replies: 5
    Last Post: 01-11-2004, 06:57 AM
  4. Scroll Bars and Focus
    By Thantos in forum Windows Programming
    Replies: 1
    Last Post: 08-21-2003, 11:57 AM
  5. Horizontal Scroll Bars with CListBox
    By Malek in forum Windows Programming
    Replies: 1
    Last Post: 04-10-2003, 09:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21