|
-
Sep 9th, 2000, 03:12 PM
#1
Thread Starter
Frenzied Member
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
-
Sep 9th, 2000, 03:46 PM
#2
Frenzied Member
You can set focus to the text box and Use the SendKeys to send the End key which will get you to the bottom
-
Sep 9th, 2000, 03:47 PM
#3
Thread Starter
Frenzied Member
I never tried sendkeys before, how does it work?
NXSupport - Your one-stop source for computer help
-
Sep 9th, 2000, 03:56 PM
#4
Frenzied Member
You can use:
Code:
text1.setfocus
SendKeys "{end}"
you can use
Code:
sendkeys "what ever you want"
-
Sep 9th, 2000, 04:00 PM
#5
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
-
Sep 9th, 2000, 04:12 PM
#6
Frenzied Member
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
-
Sep 9th, 2000, 04:14 PM
#7
_______
<?>
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
-
Sep 9th, 2000, 04:20 PM
#8
Thread Starter
Frenzied Member
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
-
Sep 9th, 2000, 04:23 PM
#9
_______
<?>
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
-
Sep 9th, 2000, 04:25 PM
#10
Frenzied Member
It works if you put it under click event or something
Try putting the code that way and not under text1 change event
-
Sep 9th, 2000, 04:26 PM
#11
Thread Starter
Frenzied Member
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
-
Sep 9th, 2000, 04:54 PM
#12
Lively Member
ur text box is called Text1 right?
Mag-Net's Home
Visual Studio 6-Enterprise - SP4
ICQ: 35519773
Have Fun 
-
Sep 9th, 2000, 05:07 PM
#13
_______
<?>
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|