Information générale
Catégorie:
Programmation Orientée Object
Geoff,
Do not know exactly how to bring the text to the top of the control. To the visible portion of the control you may bring it as in the MS article I gave in my previos reply.
Still I think that with .SelStart and .SelLength you may probably do what you wish:
- you may calculate the number of lines in the visible portion of the control (using control height and fontmetric() function);
- then you may force the cursor to go down (keyboard ...?) by the number of lines you calculated, and thus forcing the entire text inside to be shifted up;
- then you may force the cursor to go up and back to its initial position; it will reposition the text in the control while bringing the cursor to the first visible text line.
>Hi Sergey
>
>Yeah I've have got that far. These two (SelStart and Find) control where in the string the cursor is positioned but am unable to determine/set where in the RTF control box the text is displayed.
>
>What I am hoping to do is to be able to redraw the control so that my selected text is displayed at the top of the control. I suspect I cant but live in hope.
>
>Any ideas?
>
>Regards
>Geoff Scott
>
>>The SelStart property (like in a textbox) determines/returns position of the cursor. You can also use Find() method.
>>
>>>I am using the MS RTF control to display text and want to be able to position within the text but unfortunately cannot figure out how to go about doing that.
>>>
>>>Could someone please post some code or point me to where I can find the documentation on the RTF OLE control.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement