Click here to Skip to main content
15,889,556 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need a small problem solution.

in button1 I code =
Textbox1.Text = "P";

When I click on button1 in textbox1 show =P

but I want
I I pressed button1 3times in textbox1 will show="PPP"
If pressed 4 times it will show ="PPPP"

How to do this?

With my current code of I pressed button1 1000 times it. shows = "P "

Thanks in advanced
Posted

Hey there,

Just add 'P' to the existing value of the TextBox,

C#
TextBox1.Text = TextBox1.Text + "P";

or
C#
TextBox1.Text += "P";


Azee...
 
Share this answer
 
Comments
Thomas Daniels 7-Oct-13 14:02pm    
+5!
What you are asking for is How to Concatenate Strings[^]

You'd want something like this:
C#
Textbox1.Text += "P";
 
Share this answer
 
Comments
Thomas Daniels 7-Oct-13 14:02pm    
+5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900