|
-
Dec 31st, 2002, 12:07 AM
#1
Thread Starter
Lively Member
Question about the code..
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?
-
Dec 31st, 2002, 12:21 AM
#2
Lively Member
use MultiLine = true in textbox properties
-
Dec 31st, 2002, 01:28 AM
#3
Frenzied Member
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
NXSupport - Your one-stop source for computer help
-
Dec 31st, 2002, 11:27 AM
#4
Thread Starter
Lively Member
Thanks !! one more question.
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.
-
Dec 31st, 2002, 11:41 AM
#5
Lively Member
Well, you'd have to decide where in the text in textbox2 you want it, first. The beginning or end are trivial:
VB Code:
textbox2 = textbox1 & " " & textbox2 'beginning
textbox2 = textbox2 & " " & textbox1 'end
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.
-
Dec 31st, 2002, 11:47 AM
#6
Fanatic Member
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
-
Dec 31st, 2002, 12:11 PM
#7
Lively Member
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.
-
Dec 31st, 2002, 12:38 PM
#8
Thread Starter
Lively Member
I.E within VB
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?
-
Dec 31st, 2002, 01:56 PM
#9
Frenzied Member
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
NXSupport - Your one-stop source for computer help
-
Dec 31st, 2002, 07:52 PM
#10
Lively Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|