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);
Define the terms Web server controls and Custom user Controls in Asp.net?
State the advantages Web services have over the Component Object Model (COM) and also the Distributed Component Object Model (DCOM)?
State how the changes made to the DataSet object are identified since it was last loaded?
What is Object?
Describe DataReader object?
Explain different types of generations in a garbage collector?
Describe memory-mapped files?
What do you mean by the term MISL CODE? Describe in brief.
Is it possible to validate a DropDownList by RequiredFieldValidator?
Explain how exception handling is changed in the .NET Framework 4.0?
18,76,764
1943405 Asked
3,689
Active Tutors
1415780
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!