Results 1 to 13 of 13

Thread: scrolling down

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    um.... I have a text box with a Vertical scroll bar, now from my program, I keep adding to the text box, is there a way to keep the scroll bar always at the bottem (so they see the new text that is being added)
    NXSupport - Your one-stop source for computer help

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    You can set focus to the text box and Use the SendKeys to send the End key which will get you to the bottom
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    I never tried sendkeys before, how does it work?
    NXSupport - Your one-stop source for computer help

  4. #4
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    You can use:
    Code:
    text1.setfocus
    SendKeys "{end}"
    you can use
    Code:
    sendkeys "what ever you want"
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    that doesn't work for me
    NXSupport - Your one-stop source for computer help

  6. #6
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    this works for me:
    Code:
    Private Sub Command1_Click()
    Dim leng, i, c As Integer
    Dim char As String
    leng = Len(Text1.Text)
    For i = 1 To leng
    char = Mid(Text1.Text, i, 1)
        If char = Chr(13) Then
        lines = lines + 1
        End If
    Next i
    lines = lines + 1
    Text1.SetFocus
    For c = 1 To lines
    SendKeys "{down}"
    Next c
    End Sub
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

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

    <?>

    Dim i
    For i = 1 To 100
    Text1.SelStart = Len(Text1.Text)
    Text1.SelText = i & vbCrLf
    Next i
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    sorry, none of the 2 above work. maybe I'm putting this in the wrong place,I'm putting it in the text change event
    NXSupport - Your one-stop source for computer help

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

    <?>

    maybe you are.
    let's see your usage of it.

    if you cut and paste my code and click the button ten times the text box will scroll so you can read the last entry
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  10. #10
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    It works if you put it under click event or something
    Try putting the code that way and not under text1 change event
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    this isn't exactly it but something similar
    Code:
    Public Sub Timer1_Timer ()
    text1.text = text1.text & "fsadfkjasgdflkas"
    End Sub
    
    
    Private Sub Text1_change ()
    'your code
    end sub
    NXSupport - Your one-stop source for computer help

  12. #12
    Lively Member
    Join Date
    Mar 2000
    Location
    Lowestoft
    Posts
    91
    ur text box is called Text1 right?
    Mag-Net's Home
    Visual Studio 6-Enterprise - SP4
    ICQ: 35519773
    Have Fun

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

    <?>

    Code:
    Option Explicit
    
    Public i As Integer
    
    Private Sub Form_Load()
    Timer1.Interval = 4
    End Sub
    
    Private Sub Timer1_Timer()
    
    i = i + 1
    Text1.Text = Text1.Text & "fsadfkjasgdflkas"
    Text1.SelStart = Len(Text1.Text)
    Text1.SelText = i & vbCrLf
    
    If i = 20 Then Timer1.Enabled = False
    
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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