Change the text of a textbox in Visual Studio.
Alex
-
Anonymous user -
Anonymous user -
Salut,
I have an idea for a program to create in VS, but I don't know how to do it... Let me explain: I would like to make it so that when I click on a button in my Form1, something gets written between the lines already present in my TextBox. For example:
"1 Bonjour,
2 Blablabla
3 Texte texte texte bref"
and I would like to insert "je m'appelle quelqu'un" by pressing the button between line 1 and line 2...
I hope I was clear, and thank you for your responses ;)
Alex
I have an idea for a program to create in VS, but I don't know how to do it... Let me explain: I would like to make it so that when I click on a button in my Form1, something gets written between the lines already present in my TextBox. For example:
"1 Bonjour,
2 Blablabla
3 Texte texte texte bref"
and I would like to insert "je m'appelle quelqu'un" by pressing the button between line 1 and line 2...
I hope I was clear, and thank you for your responses ;)
Alex
1 answer
-
Good evening
You can split the text using "\r\n" as a delimiter, and reconstitute the text with the split elements and the text to be added.
You can also find the position of the first newline, cut it, and reassemble it.
Obviously, this constitutes basic string operations. Since in your training you are already using forms and buttons, this has been mastered for a long time, hasn't it?
Or else, like many self-taught individuals, you put the cart before the horse.
I did the same thing a long time ago. But it's not something that can be improvised.
The best advice I can give you is to put your project aside for a few days to take an online course.
This one is good https://tahe.developpez.com/dotnet/csharp/
It won't make you an exceptional coder, but it will give you the basics to start your learning under good conditions.
--
When I was little, the Dead Sea was only sick.
George Burns