by MisterT (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 23rd November 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This simple snippet helps you make the scrollbar on a textbox(MultiLine) stay DOWN. It also teaches you how to add a new line, instead of
API Declarations
NOTE! Make a commandbutton(Command1) and a textbox(Text1)
Set these properties on Text1:
-Multiline: True
-Scrollbars: 2(Vertical)
Static Round As Integer
Round = Round + 1
Randomize Timer ' make a random seed, based on the Timer
Dim a As Integer ' make it an Integer to remove decimals
a = 16 * Rnd + 1 ' pick a random # between 1 and 16
NewLine = Chr(13) + Chr(10) ' This creates a new line when typed in a textbox
Text1 = Text1 + NewLine ' add a blank line
Text1 = Text1 & "--ROUND#" & Round & "---" & NewLine ' Type the round number
Text1 = Text1 & "Yndolia casts Fireball, and hit Erwulf, Harald and Fiona for <" & a & "> points of damage." + NewLine
Text1.SetFocus ' set the focus to Text1
SendKeys "^{End}" ' Send the key [CTRL] and [End] to make the typing cursor go down, wich in turn makes the scrollbar stay DOWN.
End sub
No comments have been posted about This simple snippet helps you make the scrollbar on a textbox(MultiLine) stay DOWN. It also teaches. Why not be the first to post a comment about This simple snippet helps you make the scrollbar on a textbox(MultiLine) stay DOWN. It also teaches.