15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CRichEditCtrl and Caret positioning...

Reza Razavipour -- biles.com!reza_r@jabberwock.biles.com
Thursday, October 03, 1996

Environment: VC 4.1 on NT 3.51

I changed a CEdit control to a CRichEditCtrl and now all my SetSel
calls to move my caret position dont seem to do anything. Am I missing
something here?

TIA

Reza



Gabriel Parlea-Visalon -- Gabriel@derivs.demon.co.uk
Tuesday, October 08, 1996

In your message dated Thursday 3, October 1996 you wrote :
> Environment: VC 4.1 on NT 3.51
> 
> I changed a CEdit control to a CRichEditCtrl and now all my SetSel
> calls to move my caret position dont seem to do anything. Am I missing
> something here?
> 
> TIA
> 
> Reza
> 

CEdit::SetSel() is primarely used to select a range of characters in an edit 
control. By default it also scrolls the caret into view but it can be set not 
to.
CRichEditCtrl::SetSel() does the selection but does not move the caret into 
view. Luckily, it places it at the end of the selection indicated by the greater 
character index.

See the Class Library Reference entries on the above two topics.

Both CEdit and CRichEditCtrl classes have member functions like LineFromChar(), 
GetLineCount() and LineScroll() which can be used to scroll the line and the 
character after which the caret is placed into view.

I hope this helps you.

Gabriel

-- 
                             Gabriel Parlea-Visalon
                               Software Engineer
                           Derivative Trading Systems
                           gabriel@derivs.demon.co.uk





| Вернуться в корень Архива |