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 events which occur when the client requests the ASP.NET page from IIS server?
Briefly describe navigation controls. List the navigation controls that are present in ASP.NET 4.0?
Distinguish between toolstrip drop-down button and toolstrip split button?
Illustrate the term Namespace also its uses?
What is the requirement of Copy Web Site?
Is it possible to set which kind of comparison we want to perform by the CompareValidator control?
Briefly explain Application Cache?
State the naming conventions essential for XML elements tags?
Describe in brief regarding the visual basic?
Which event controls are completely loaded?
18,76,764
1950421 Asked
3,689
Active Tutors
1456263
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!