Results 1 to 10 of 10

Thread: textbox scrollbars

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,092
    How come in Windows NotePad, when you click "Word Wrap" off,
    it adds a horizontal scroll bar, but when I tried to emulate that, it has an error saying that I can't change a read-only property(i.e. - scrollbar orientation)?

    How would I do that then?

  2. #2
    Hyperactive Member Asaf_99's Avatar
    Join Date
    Jul 2000
    Location
    Israel
    Posts
    335
    I'm not really sure what yuo mean but I think this would help... :
    Code:
    Text1.Scrollbars = x
    'Replace x with one of the following:
    '0 = None
    '1 = Horizontal
    '2 = Vertical
    '3 = Both
    Asaf Sagi

    ICQ: 61917199
    E-Mail: sagiasaf@netvision.net.il

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    You can add or change scrollbars and properties at design time only.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,092
    so how does NotePad do it??

  5. #5
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    What about having two textboxes.
    That you assign one textbox the wrap thing but not to the other one.
    Now every time the user switches you assing the other textbox the text of the one that was active. than you make one of them invisible. (I know it isn't perfect, but it will work, you can clear the one of those box that isn't active, to save memory)
    Sanity is a full time job

    Puh das war harter Stoff!

  6. #6

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,092
    I was thinking about that, I guess that's how its going to have to be.

  7. #7
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    tell me if it worked out fine when you are done.
    Sanity is a full time job

    Puh das war harter Stoff!

  8. #8
    Junior Member
    Join Date
    Aug 2000
    Posts
    30

    Cool notepad does it this way

    If you use toolz like spy++ and spy notepad, you'll see that it uses two edit-ctrls, cause there are two different hwnds!

    /\/\isanThr0p: HA! MAL N DEUTSCHER BEI VBWORLD...
    Currently using VB6 Enterprise, but VC++ is much better for API ( )!

  9. #9
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Hehe ich habe im Ganzen forum nur 4 deutsche Ausmachen keonnen, von denen einer aus der Schweiz ist lol!

    Sorry ppl! I couldn't resist! I'm really wondering why microsoft didn't just code a new textbox, instead of just giving a real simple thing that wastes memory! I don't think it cares a lot, but if they do it with all their stuff like this...
    Sanity is a full time job

    Puh das war harter Stoff!

  10. #10
    Guest

    Re: <?>

    Originally posted by HeSaidJoe
    You can add or change scrollbars and properties at design time only.
    I'm here to prove you wrong Wayne .
    Scrollbars can be hidden or shown during runtime.

    Code:
    Private Declare Function ShowScrollBar Lib "user32" _ 
    (ByVal hwnd As Long, ByVal wBar As Long, _ 
    ByVal bShow As Long) As Long 
    
    Private Const SB_BOTH = 3 
    Private Const SB_HORZ = 0 
    Private Const SB_VERT = 1 
    
    Private Sub Command1_Click() 
    ShowScrollBar Text1.hwnd, 3, False 
    End Sub 
    
    Private Sub Command2_Click() 
    ShowScrollBar Text1.hwnd, 3, True
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width