Fonts with textbox

aditya12c

Active member
Joined
Aug 21, 2005
Messages
26
Programming Experience
Beginner
i have 2 text box and 1 button
Button1, TextBox1 and TextBox2
i am applying font and color to TextBox2
now when i click on Button 1, i need to send text of TextBox2 to TextBox1.
code for that is simple
on click of button1
TextBox1.text=TextBox2.text

Problem i am facing here is font and color which i changed in textbox2 is not transfered to textbox1. Why? What should i do? please help
Thanks
 
you need to set font and color to textbox1 and textbox2. your code:

TextBox1.text=TextBox2.text

transfers only text, not style

in your case you can use this:

VB.NET:
        Me.TextBox1.Text = Me.TextBox2.Text
        Me.TextBox1.ForeColor = Me.TextBox2.ForeColor
        Me.TextBox1.Font = Me.TextBox2.Font
 
Back
Top