Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Разработка Windows Forms > Как в RichTextBox узнать положение каретки


Автор: Homer 16.1.2008, 08:25
   Че то никак не могу найти, каким образом можно узнать положение каретки в RichTextBox (и т.п)?Подскажите пжалста.

Автор: Aline 16.1.2008, 09:13
Честно говоря в .Net я не делала, а в Борланде у  RichEdit было свойство CaretPos со совими x и координатами

Автор: Homer 16.1.2008, 09:44
   Не, такого там нет. 
   Блин, я уж все облазил -  и в мсдне смотрел, и в самих этих метаданных, нигде ничего про каретку нету  smile 

Автор: 1stain 16.1.2008, 09:56
RichTextBox.SelectionStart

Автор: Aline 16.1.2008, 11:47
RichTextBox.GetPositionFromCharIndex Method  - это не поможет?

Retrieves the location within the control at the specified character index. 

This method enables you to determine where in the control a specific character index is located. You can use this method for such tasks as displaying shortcut menu items or help information for a word in the control. For example, if you wanted to display a menu of options to the user when the user right clicks on a word in the control, you can use this method to determine the position of the word to properly display a ContextMenu control.

Автор: mgukov 29.8.2010, 13:36
Может быть AutoScrollOffset

Автор: m0dest 29.8.2010, 21:21
http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox.caretposition.aspx
Это возможно то?

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)