[.net] How to select/HIGHLIGHT one line in a multiline textBox?

Started by
10 comments, last by Machaira 16 years, 2 months ago
I oftenly heard about write/make a custom control. How to do that?
Do you have any code sample?

So I must check if the line is equal to "\r\n" ?

I also have problem here with inserting new lines. Everytime user click button Compare, I compare the line count between Source textBox and Destination textBox. If one of them smaller, I insert new lines.

When users change one of the file and load new file, for case of file that stays in the textBox has fewer line count than the new files, it will be compared in a condition of added new lines.

First of all, a user compare file A ( 30 lines ) and file B ( 26 lines ). To make this equal so that I can select the empty line to show the difference, I must insert 4 new lines.

So, now A = B = 30 lines.

It's done.

Next thing, user pick a new file to replace A with let say C (20 lines), B remains in the textBox (30 lines). To make C equal with B ( 30 LINES ! ) I must insert 10 empty line. So, it is wrong. The correct one should only 26(actual B line count) - 20(actual C line count) = 6 lines NOT 30(modified B line count) - 20 = 10.

Do you get what I mean?

How to check and remove all the added lines when user pick a new file?


Ok, thank you everyone for the information.

[Edited by - chrisliando on February 18, 2008 9:18:53 PM]
Advertisement
You're aiming too high. Try something easier.

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

This topic is closed to new replies.

Advertisement