views:

155

answers:

1

Hi,

I am working on a text editor that is based on RichEditBox. I have implemented functionality "Go to line" which eventually resolves to TextPointer.Paragraph.BringIntoView();

Along with this I also set the caret position. What I found out is that BringIntoView only works when I click on the RichEditBox first (focus it). Otherwise it seems to get ignored. I can see that the caret position has been adjusted by the code around BringIntoView though.

Does anybody know what is the reason/nature of that problem? How can I overcome it?

A: 

Can't you just give the RichTextBox(?) focus first then, using Keyboard.Focus(richTextBox) or richTextBox.Focus()?

Oskar
Of course I tried that first. It doesn't help. But even if it does - that might be not quite correct (changing the focus) in the application UI context.
pavele