I can now place text into text box2 however if I want to copy more than 1 word like a paragraph.. so command1
text1.text = " hello" works but what if I want to diplay a paragraph?
Printable View
I can now place text into text box2 however if I want to copy more than 1 word like a paragraph.. so command1
text1.text = " hello" works but what if I want to diplay a paragraph?
use MultiLine = true in textbox properties
after you set the multiline to true, you could do something like this:
text1.text = "Hello World this is my first line" & vbnewline & "Hello world this is my second line"
and so on
-Dimava
Thank you for the help ok that worked but I have yet another question.. I have a text box ( let's say I put in a name like "Nelson") in that text box, and once my command button is pressed (that sends a sentence over yet to another text box) I would like it to place nelson into a certain part of that paragraph.
so someone enters a word into textbox 1 I would like that word placed in textbox 2 in the middle of a sentence. or end ect.. thank you.
Well, you'd have to decide where in the text in textbox2 you want it, first. The beginning or end are trivial:
I'm not sure of the function to insert in the middle of a string; you could use Replace() and hack it a bit, but there's probably a better way.VB Code:
textbox2 = textbox1 & " " & textbox2 'beginning textbox2 = textbox2 & " " & textbox1 'end
An easy way to do that is to use variables. In code you can do something like this
VB Code:
Option Explicit Private Sub Command1_Click() Text2.Text = "Hello " & Text1.Text & ", How are you?" End Sub
Yes, but what if you have existing text in text2 and want to insert into that? I couldn't find an Insert() function in VB, although other languages have one.
quick question I want to disply a webpage within my VB do I use a label?
for example I want it to display withing a box..
so www.lycos.com (entered in textbox1)
and would like it to
display withing another text box or label on the form?
Right click your tool box, goto components
scroll down and put a check next to Microsoft Internet Controls
and then you would use something like webbrowser1.navigate text1.text
To insert text from a textbox to another you can do something like this:
VB Code:
Private Sub Form_Load() Text1.Text = "Name" Text2.Text = "Hello how are you" End Sub Private Sub Command1_Click() Text2.Text = Left(Text2.Text, 5) & " " & Text1.Text & " " & Mid(Text2.Text, 7) End Sub