Forum

Log In Sponsors
Partner Sites
Board index Programming Visual Basic Forum

Add Text To a textbox by a button?

Moderator: dafunkymunky

Add Text To a textbox by a button?

Postby spil778 on Sun Oct 04, 2009 9:04 pm

Hi i want to make a html maker. :mrgreen:
so could somebody give me the code to add text to a textbox by a button click? :?:
spil778
 
Posts: 2
Joined: Sun Oct 04, 2009 8:59 pm

Re: Add Text To a textbox by a button?

Postby pachecf on Thu Oct 08, 2009 9:27 pm

You want to add text to a text box when pressing a button?

Drop a text box control and a command button control to your form.
Double click the command button to start writing code.
and type:

Text1.Text = "Anything you want here"

Go to your form and click one time on the Text1 control and set the scrollbar property to Both and Multiline = True. This way you can write multiple lines so you can later copy and paste somewhere else.

You can try this:

Text1.Text = "Anything line 1" & vbcrlf & "Second Line" & vbcrlf & "Third Line"

Or
Text1.Text = "Anything line 1" & vbcrlf & _
"Second Line" & vbcrlf & _
"Third Line"
pachecf
 
Posts: 6
Joined: Thu Oct 08, 2009 9:18 pm

Re: Add Text To a textbox by a button?

Postby n00bl3z on Sat Nov 21, 2009 2:20 am

spil778 wrote:Hi i want to make a html maker. :mrgreen:
so could somebody give me the code to add text to a textbox by a button click? :?:

Code: Select all
textboxl1.text = textbox1.text + "text"
n00bl3z
 
Posts: 4
Joined: Thu Sep 24, 2009 4:29 am


Return to Visual Basic Forum

Who is online

Users browsing this forum: No registered users and 0 guests