Hey Simon
Issue 1: This is occurring because your container is swallowing the
key events. You need to find out which method to override and return
false. For example, embedding Scintilla in a Control in C#, you need
to override the following method:
protected override bool ProcessDialogKey(Keys keyData) {
return false;
}
The control then forwards the necessary key events to scintilla
itself. With VB I assume you will add the event handler, and then set
one of the event properties to False.
Issue 2:
How are you settting the caret position and getting focus? In C#, I'd
set the caret position and use the GRABFOCUS call, like so:
scintilla.CurrentPos = 3;
scintilla.SelectionStart = scintilla.CurrentPos;
scintilla.SelectionEnd = scintilla.CurrentPos;
scintilla.GrabFocus();
These will of course need to be adapted to ScintillaVB, but the
concepts should be the same.
If you are moving the caret position to somewhere outside of the
visible area, you will also need to call the ScrollCaret() method to
ensure the current position is scrolled into view.
Hope that helps,
Matt
On 02/03/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> Question about history.
>
> I'm stuck using a VB6 environment. I've gor ScintillaVB and modified it for
> my application (basically adding extra interfaces). The cursor keys don't
> work, but they do with shify and CTRL.
>
> I searched the archive, and found a previous post on this. The suggestion
> was to try KeyPreview. Ive turned this on and put KeyUp and KeyDown
> handlers (KeyPress event returns ASCII code only - so doesn't work for
> cursor or F keys having KeyUp/KeyDown and KeyPress is nonsense anyway) into
> the form where the ScintillaVB control is placed. Pressing letter keys
> causes the sequence KeyDown event, the letter appears in the Scintilla
> window, KeyUp event. Pressing a cursor key with shift or CTRL generates a
> KeyDown, text highlights in scintilla widow (for shift), KeyUp. Pressing
> just the cursor key has no effect in the scintilla window and no events are
> generated in the form.
>
> As a second issue, when I set the focus to the scintillaVB control the caret
> does not appear at its current position. Also when I programatically move
> the current position, the text moves, but the caret is not shown.
>
> Clues please - I'm tearing my hair out.
>
> TIA
>
> Simon
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit
> http://www.messagelabs.com/email
> ______________________________________________________________________
>
> _______________________________________________
> Scintilla-interest mailing list
> [email protected]
> http://mailman.lyra.org/mailman/listinfo/scintilla-interest
>
>
>
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest