You are viewing our Forum Archives. To view or take place in current topics click here.
how would i make it so that it made a new line when i press
Posted:

how would i make it so that it made a new line when i pressPosted:

blueninjn
  • Junior Member
Status: Offline
Joined: Dec 28, 201310Year Member
Posts: 85
Reputation Power: 3
Status: Offline
Joined: Dec 28, 201310Year Member
Posts: 85
Reputation Power: 3
how would i make it so that it would make a new line in the textbox area (i have multi-line enable) but i need it so that when i press a button it would have the same effect as pressing enter (visual basics)
#2. Posted:
Int
  • Comment King
Status: Offline
Joined: Mar 03, 201212Year Member
Posts: 5,832
Reputation Power: 2929
Status: Offline
Joined: Mar 03, 201212Year Member
Posts: 5,832
Reputation Power: 2929
Can you give us more in depth explanation please, or show use the code, or what you mean?
#3. Posted:
Botch
  • TTG Senior
Status: Offline
Joined: Aug 31, 201212Year Member
Posts: 1,553
Reputation Power: 65
Status: Offline
Joined: Aug 31, 201212Year Member
Posts: 1,553
Reputation Power: 65
It should be something along the lines of this (note I do not normally program in VB, so the syntax might be a bit off):

textBox1.text = "Line 1" & Environment.NewLine & "Line 2";
#4. Posted:
joeisjoe5
  • Rising Star
Status: Offline
Joined: Jun 18, 201212Year Member
Posts: 775
Reputation Power: 31
Status: Offline
Joined: Jun 18, 201212Year Member
Posts: 775
Reputation Power: 31
Under the sub for the button being pressed just put
TextBox1.Text = TextBox1.Text & vbCrLf
TextBox1.SelectionStart = TextBox1.Text.Length + 1


I believe this will also work
TextBox1.Text += vbCrLf
TextBox1.SelectionStart = TextBox1.Text.Length + 1
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.