Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to highlight the text backcolour in textbox line by line using c#.net
Posted

1 solution

The question is not tagged with the UI.
In Windows Forms, the TextBox control does not support assigning different BackColor for different lines.
For this purpose the RichTextBox control explained here
http://msdn.microsoft.com/en-us/library/3tdc88y7.aspx[^]
can be used.
However, to highlight a contiguous block of Text the SelectionStart and SelectionLenth properties of TextBox can be used as explained here
http://msdn.microsoft.com/en-us/library/system.windows.forms.textboxbase.selectionstart.aspx[^]
 
Share this answer
 
v2
Comments
Sandeep Mewara 25-Apr-12 11:19am    
My 5!
VJ Reddy 25-Apr-12 11:38am    
Thank you, Sandeep.

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