Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

phil05

Visual Basic: Doing a new line in a multiline textbox?

This topic is 5280 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
How would you set that up in this?


Private Sub UserInput_KeyDown(KeyCode As Integer, Shift As Integer)
If (KeyCode = vbKeyReturn) Then ' If Player Presses Return in Input Box...
sInput = UserInput.Text ' User Input gets stored in sInput
GameMain.Text = sInput ' sInput gets put into GameMain.text
GameMain.Text = vbCrLf ' New Line
UserInput.Text = "" ' Clear User Input Box

End If


[edited by - philvaira on June 3, 2004 6:19:23 PM]

Share this post


Link to post
Share on other sites
Try it like this:

Private Sub UserInput_KeyDown(KeyCode As Integer, Shift As Integer)
If (KeyCode = vbKeyReturn) Then ' If Player Presses Return in Input Box...
sInput = UserInput.Text ' User Input gets stored in sInput
GameMain.Text = GameMain.Text + sInput + vbCRLF ' Textbox is set to its current contents plus the new text, and a newline.
UserInput.Text = "" ' Clear User Input Box

End If


[edited by - TravisWells on June 3, 2004 6:54:32 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!