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);
Name the different types of authentication techniques which are used in the connection strings to connect the .NET applications with the Microsoft SQL Server?
State the naming conventions essential for XML elements tags?
Explain the term Merge Module projects?
Explain Windows services?
What is HTML server control in ASP.NET?
Describe regarding the Visual basic.NET culture in brief.
Write about features that are added in the .NET Framework 4.0.
By which method we can add or remove rows from a DataTable object of DataSet?
Explain the XmlWriter class.
List out the different components of an assembly.
18,76,764
1931678 Asked
3,689
Active Tutors
1412350
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!