Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Scrolling a textbox w VB (2000)

    In <post#=317422>post 317422</post#> I asked how to scroll a textbox on a USERFORM automatically to the top with VB. Hans gave us the answer: TextBox1.SelStart = 0

    Now I want to do the same with an ActiveX textbox which in NOT on a userform but directly on a worksheet. The above solution doesn't seem to work for me. Any suggestions?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Scrolling a textbox w VB (2000)

    What kind of ActiveX text box do you mean? The one from the Control ToolBox? Although Me.TextBox1.SelStart = 0 works in the module belonging to the worksheet, it isn't very useful.

  3. #3
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Scrolling a textbox w VB (2000)

    Hans,
    Yes, the textbox was made from the Control toolbox as opposed to the FORMS textbox.

    I want to be able to reset the scoll to the top.
    Also, I notice that the scrollbar (which I enabled in the properties panel) does NOT show unless the toolbox is manually selected. how do i make it visible?

    Thanks
    Paul

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Scrolling a textbox w VB (2000)

    I think that the scroll bar is only visible when the text box "has the focus". That's the way it was designed.

    When do you want to scroll to the top? When the user activates the text box? You could use the GetFocus event, but it might be disconcerting to the user that the insertion point jumps away each time (s)he activates the text box:

    Private Sub TextBox1_GotFocus()
    Me.TextBox1.SelStart = 0
    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
  •