Check ChildStates while typing

SyntaxEditor for Windows Forms Forum

Posted 11 years ago by Ernesto Obregon
Avatar
How can I check the current ChildState as I am typing in the Editor. I know to use the KeyDown, or KeyTyping or KeyTyped events to trap for the keys being pressed, but while doing that I want to be able to check what ChildState I am in so I can keep my intelliprompt feature from popping up while in a <ChiledState Key="CommentState">

Also can this be done in my DynamicLanguage.vb class or is it better to trap for it in one of the KeyTyping events of my mainform.vb?

Thanks
Ernesto

Comments (2)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We've designed SyntaxEditor so that you can handle most things in the language class if you like. For instance there is an OnSyntaxEditorKeyTyped method in there.

In our MainForm sample, check out editor_SelectionChanged. In there you'll find code how to access the current token by the caret and from that you can get the lexical state, etc.


Actipro Software Support

Posted 11 years ago by Ernesto Obregon
Avatar
That will about do it. "I love it when a plan comes together" Hannibal

Dim token as IToken = editor.Document.Tokens.GetTokenAtOffset(editor.Caret.Offset)
Dim DeclaringState as string = token.DeclaringLexicalState.Key.ToString
Thanks
The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.