Scroll to bottom of a loaded multiline Text Box
Scroll to bottom of a loaded multiline Text Box
Rate Scroll to bottom of a loaded multiline Text Box
(1(1 Vote))
'vertical scroll bar, and scroll to the end
Dim logfile as string
Dim LogFileNum as Integer
'Put the file contents into the textbox (txtLogFileContents)
LogFileNum = FreeFile
Open logfile For Input As #LogFileNum
txtLogFileContents.Text = Input$(LOF(LogFileNum), #LogFileNum)
Close LogFileNum
'Scroll to end of text box
'NOTE: I tried txtLogFileContents.SetFocus but I got an error 5 on compile
txtLogFileContents.SelStart = Len(txtLogFileContents.Text) 'sets focus
SendKeys "^{end}" 'advances scroll to end
Scroll to bottom of a loaded multiline Text Box Comments
No comments yet — be the first to post one!
Post a Comment