Thread: Edit Box Scroll Bars

  1. #1
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378

    Edit Box Scroll Bars

    hey, this is annoying me. i have an edit box...next to it is a [Browse] button for the user to browse for a text file to select for analyzing / modifying purposes... it ALWAYS has a horizontal scrollbar >:O i want it to be able to scroll horizontally but only when its needed.. i would also like the same effect for a vertical scrollbar on a static control (can static controls scroll?) which will contain the analysis / modification. if static controls cannot have a scrollbar, its not rocket science to change it to an edit control

    thanks
    Registered Linux User #380033. Be counted: http://counter.li.org

  2. #2
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    bah so i'm stuck w/the scrollbars? theres gotta be a way because other programs do it.. lol

    Registered Linux User #380033. Be counted: http://counter.li.org

  3. #3
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    What other programs? List some examples so I can take a look, and maybe think of a solution.

  4. #4
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    notepad, wordpad, word... lol
    Registered Linux User #380033. Be counted: http://counter.li.org

  5. #5
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Google it.

  6. #6
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    ok, so i had the brilliant realization to do something similar to my word wrap function in another program. but is there a way to tell if the text in the edit control exceeds the viewable area? because i'm thinking if you can find out if it goes off the screen, then you could add the WS_HSCROLL style to the window and remake it..
    Registered Linux User #380033. Be counted: http://counter.li.org

  7. #7
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Quote Originally Posted by willc0de4food
    notepad, wordpad, word... lol
    Notepad only scrolls horizontally when the Word Wrap feature is enabled. And it always shows the horizontal scrollbar when Word Wrap is enabled.

    I'm don't think it does what you say here

    it ALWAYS has a horizontal scrollbar >:O i want it to be able to scroll horizontally but only when its needed

  8. #8
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    w/notepad / wordpad / word i meant the vertical scrollbar. for some reason i get WS_VSCROLL and WS_HSCROLL mixed up sometimes.

    I'm don't think it does what you say here
    but i promise you, it does: http://img.photobucket.com/albums/v4...85/babbler.jpg
    Code:
    case WM_CREATE:
    {
                 CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("EDIT"), TEXT(""), 
                   WS_VISIBLE | WS_CHILD | WS_HSCROLL | ES_AUTOHSCROLL, 22, 20, 155, 40, hwnd, (HMENU)ID_DIRFIELD, 
                   g_hInst, NULL);
                 
                 CreateWindowEx(0, TEXT("BUTTON"), TEXT("Browse"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, 
                   197, 20, 65, 25, hwnd, (HMENU)ID_BROWSEBTN, g_hInst, NULL);
                 
                 CreateWindowEx(0, TEXT("BUTTON"), TEXT("Analyze"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, 
                   50, 70, 70, 25, hwnd, (HMENU)ID_ANALYZEBTN, g_hInst, NULL);
                 
                 CreateWindowEx(0, TEXT("BUTTON"), TEXT("BabbleIt"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, 
                   150, 70, 70, 25, hwnd, (HMENU)ID_BABBLEITBTN, g_hInst, NULL);
                 
                 CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("STATIC"), TEXT(""), WS_VISIBLE | WS_CHILD | ES_READONLY, 
                   22, 110, 240, 140, hwnd, (HMENU)ID_DISPLAY, g_hInst, NULL);
    }
    break;
    Last edited by willc0de4food; 10-19-2005 at 12:10 PM.
    Registered Linux User #380033. Be counted: http://counter.li.org

  9. #9
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    I look at that picture, and it seems that it always has the horizontal scrollbar there.
    Unless you mean the vertical scrollbar?

  10. #10
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    thats what i said, it always has the horizontal scrollbar. lol i dont want it to.

    when i was speaking of other text editors, i was referring to the vertical scrollbar b/c if you look in the picture, the larger static area may have text that extends beyond the display area.
    Registered Linux User #380033. Be counted: http://counter.li.org

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with edit box and vert scroll
    By AndewWood in forum Windows Programming
    Replies: 11
    Last Post: 01-08-2008, 02:00 AM
  2. edit box
    By beene in forum Windows Programming
    Replies: 3
    Last Post: 11-11-2006, 04:40 AM
  3. WS_HSCROLL in ES_READONLY edit box error
    By Homunculus in forum Windows Programming
    Replies: 4
    Last Post: 02-13-2006, 08:46 AM
  4. setting fixed floats in edit box
    By WaterNut in forum Windows Programming
    Replies: 4
    Last Post: 08-13-2004, 09:13 AM
  5. Scroll Bars
    By bc17 in forum Windows Programming
    Replies: 2
    Last Post: 02-21-2003, 03:15 PM