rich text box cursor position? 
Author Message
 rich text box cursor position?

hi,

how can I get the line and character number of current cursor position in
RichTextBox control??

Thank's
Nima.



Sat, 09 Apr 2005 17:46:04 GMT  
 rich text box cursor position?
these methods use position of the mouse cursor,I think.

but what I want is line and char number of the current selected text in the
textbox.



Quote:
> Nima,

>     Assuming you have the current cursor position already, you can get the
> character index from a position by calling the GetCharIndexFromPosition.
> Also, you can get the line number by calling the GetLineFromCharIndex.

>     Hope this helps.

> --
>                - Nicholas Paldino [.NET/C# MVP]



> > hi,

> > how can I get the line and character number of current cursor position
in
> > RichTextBox control??

> > Thank's
> > Nima.



Sat, 09 Apr 2005 21:35:33 GMT  
 rich text box cursor position?
Nima,

    Assuming you have the current cursor position already, you can get the
character index from a position by calling the GetCharIndexFromPosition.
Also, you can get the line number by calling the GetLineFromCharIndex.

    Hope this helps.

--
               - Nicholas Paldino [.NET/C# MVP]


Quote:
> hi,

> how can I get the line and character number of current cursor position in
> RichTextBox control??

> Thank's
> Nima.



Sat, 09 Apr 2005 21:15:23 GMT  
 rich text box cursor position?
Nima,

    You can use the SelectionStart property to get the character index of
the beginning of the selection, and then pass that to the
GetLineFromCharIndex method to get the line.

--
               - Nicholas Paldino [.NET/C# MVP]


Quote:
> these methods use position of the mouse cursor,I think.

> but what I want is line and char number of the current selected text in
the
> textbox.


wrote

> > Nima,

> >     Assuming you have the current cursor position already, you can get
the
> > character index from a position by calling the GetCharIndexFromPosition.
> > Also, you can get the line number by calling the GetLineFromCharIndex.

> >     Hope this helps.

> > --
> >                - Nicholas Paldino [.NET/C# MVP]



> > > hi,

> > > how can I get the line and character number of current cursor position
> in
> > > RichTextBox control??

> > > Thank's
> > > Nima.



Sat, 09 Apr 2005 21:49:30 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Determining cursor position in text box in C++ .NET

2. Changing Rich Text Box : Text

3. how to set the position of the text-cursor ?!°

4. setting the position of the text cursor

5. Getting cursor position and text from OE compose window (Internet Explorer_Server)

6. Moving the cursor to the last position in an Edit Box

7. Cursor position within an Edit box

8. How to put out some text at cursor position in any window

9. Embedding files into Rich Text Box

10. rich text box flashes when editing

11. Paint Event isn't ever called by the Rich Text Box control

12. Print the contents of a rich text box control

 

 
Powered by phpBB® Forum Software