Place a cursor on given line-character in C sharp
How can we programmatically place a cursor on the given line or on the character in a RichTextBox control in the C#?
Expert
RichTextBox control has Lines array property that demonstrates one item of the array in separate line. Every line entry has a Length property that can be used to exactly position the cursor at the character, which is shown in the following code:
private void GoToLineAndColumn(RichTextBox RTB, int Line, int Column)
{
int offset = 0;
for(int i = 0; i < Line -1 && i < RTB.Lines.Length; i++)
offset += RTB.Lines[i].Length + 1;
}
RTB.Focus();
RTB.Select(offset + Column, 0);
Write the difference between Select clause and the SelectMany() method in theLINQ?
Elucidate Role based security?
Explain about the Take and Skip clauses?
In ASP.Net which namespaces imported automatically by Visual Studio?
Explain Common Type System (CTS)?
Explain types of XML Application Programming Interface (API).
What are literals and name the different types of literals in visual basic?
List the difference between points, pixels, and em's at the time when fonts are displayed?
Explain the purpose of the JIT compiler in .NET Framework?
Explain about the UpdatePanel control.
18,76,764
1941101 Asked
3,689
Active Tutors
1424126
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!