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);
In what way we can deploy the ASP.NET Web application?
Which method is used in .NET to enforce garbage collection?
Write the name of two new properties that are further added in an ASP.NET 4.0 Page class?
Explain about the different services provided by the DLR to CLR.
By which method we can post a Web page to another Web page?
State some of the different ways in order to pass parameters to the server?
Explain the concept of Web services.
Illustrate Queues and Stacks?
Why there is a requirement of user-defined controls?
What does a break statement do in the switch statement?
18,76,764
1956836 Asked
3,689
Active Tutors
1436098
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!