Let’s say I have some batch code that prints out a hello world program in batch, and I have placed the code into a rich text box (that is in visual C# .NET):
@echo off
cls
title Hello World
echo Hello World
pause
Now, I want to be able to highlight a line, or part of a line, and then comment out that highlighted line by adding a “::” to the front.
So for example, if I highlighted “echo”, and then clicked a button, it would insert a “::” to the front of the line.
How would I do that in code?
Is about how I would do it. It will handle multiple lines, and it will add the comment on the selected lines regardless of the actual selection area.