Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert text into WPF textbox before the old text

Tags:

c#

wpf

textbox

how i can Insert text into WPF textbox before the old text

like old text then i add text new text old text

like image 351
Tarek Saied Avatar asked Apr 27 '26 07:04

Tarek Saied


1 Answers

you can use either

textbox.Text="my new text" + textbox.Text;

or

 txtbox1.SelectionStart = 0;
 txtbox1.SelectedText = "my new text";
like image 116
S3ddi9 Avatar answered Apr 29 '26 20:04

S3ddi9



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!