Copy Text

Snookie

Active member
Joined
Dec 13, 2010
Messages
29
Programming Experience
Beginner
Hey all.

I will try to explain what i want to do.

I have make 3 textbox in form1
And i have a form2
where i have a Textbox ( Multiline )
What i want i want to have the text from the 3 textbox to my textbox in form2.

textboxt1.text = tennis
textboxt2.text = boys
textboxt3.text = 01-01-2011

In my form2 textboxt.text in preview
there i want to se

Type : tennis
br
Male/Femal : Boys
br
Date : 01-01-2011

How cant i do what...?
If i decide to change textbox1.text to another text. how cant it change on my preview

My preview its form2

I hope some one can help me.
 
VB.NET:
form2.Preview.Text = "Type: " & Textbox1.Text & vbNewline & ...
form2.ShowDialog()
 
No it's not the way I want it, I think I explained myself wrong.

What I want is
You write some text in TextBox1 and TextBox2 and TextBox3.
Well then click the Preview button, then in form2 TextBoxPreview show the 3 lines from respectively from Textbox1, TextBox2 and Textbox3.

And when you see the actual text in form2 preview.Text and thought you want to change TextBox1.Text to something else, go back to Form1 and change the text in TextBox1 to something other Text.
so must it be so when you walk back to the form2 Preview.Text, so you can see there are changed text in the line.

Hope I have explained myself better now.
How to do it and I can do it.?
 
You can use the TextChanged event of those textboxes and run the same code, only not use ShowDialog. The idea about ShowDialog was that you could click a button to show the 'preview' and not be able to change the source textboxes in the mean time...
 
If i try to copy the text from textbox1 and textbox2 into the textboxpreview in form2 the its only the textbox2 text i see.
its look like the last line i try to copy to the textboxpreview overwrite the textbox1 text.
i dont get the text from textbo1 and textbox2 only the last text i try to copy...

and i want to copy text1 text2 and text3 to the textboxpreview.

have you some code there can do it..
I am not sure how i doit
 
You can copy all text at the same time, just do like the code sample adding more texts to the Text. If you understand what the code in the example does you will have no problem completing the code.
 
Yes i understand.
But i have in the textboxPreview a text there are include.
look like this " ------------------------ Play the game, get fun and remember - play fair game --------------------

But then i use the code its delete the line.
And its delete all text there its write to the textpreview.text so what can i do.?
 
I think.
Can i specifite my linie in TextBoxPreview.

If i say The TextBox1.Text its a First Line in TextBoxPreview and if i change the text in the TextBox1.Text
then its only Replace the First Line in TextBoxPreview and keep the rest in the TextBoxPreview.Text some it its before i change the Text in the TextBox1.Text.


I am not sure i have Explain myself right.
I hope You can understand what i want to do...

I know there are the code in the Drawing look like this
Me.TextBox1.Location = New System.Drawing.Point(5, 5)

Can i do something like that or how i can specifide my line to the TextBoxPreview
 
Okay.

If TextBox1.Text its Line 1 in TextPreview.Text
And
TextBox2.Text its Line 2 in TextPreview.Text
And
TextBox3.Text its Line 3 in TextPreview.Text

Cant i Specifide the line number, lets say TextBox3.Text if i want to have its should be Line number 6 or 8 can i do that? and how i doit..
And If i change TextBox3.Text to another Text so cant it find out its Line number 6 and its shell shange only the Line number 6 to what i have wrote in TextBox3.Text ?
 
To do that you have to retrieve the lines from the Lines property, modify the returned String array, then 'reassign' the modified string array to the Lines property again. TextBoxBase.Lines Property (System.Windows.Forms)
Note that this is not what you originally asked for, so the scenario has now changed during the thread.
 
Sorry..
Its not work...
Its not do what i want to do... so thanks for your time, i must try to find the answer in other place.
 
Back
Top