ByulTaeng
ByulTaeng

Reputation: 1269

Using ICSharpCode.TextEditor on VB.NET

I've integrated ICSharpCode.TextEditor into VB.NET and it run smoothly without error. But, I cannot find in properties window the property to enable or select the syntax highlighting features as well as intellisense. I don't have any experience with ICSTE, so please help me. Thanks you.

Upvotes: 2

Views: 2745

Answers (2)

Stef Heyenrath
Stef Heyenrath

Reputation: 9830

See this project on github : ICSharpCode.TextEditorEx and nuget : ICSharpCode.TextEditorEx

This version exposes a property SyntaxHighlighting which you can use on designer mode to set the syntax highlighting.

Upvotes: 0

Sergey Mirvoda
Sergey Mirvoda

Reputation: 3239

Here is code from my project

//Initialize HM
HighlightingManager.Manager.AddSyntaxModeFileProvider(new FileSyntaxModeProvider(AppDomain.CurrentDomain.BaseDirectory));

//Setup current Highlighter

IHighlightingStrategy highlighter = HighlightingManager.Manager.FindHighlighter("SQL");
txtQuery.Document.HighlightingStrategy = highlighter;

Ensure that file SQL.xshd exists in AppDomain.CurrentDomain.BaseDirectory

As for entellisense you should implement it mostly yourself using this code

private void ShowCompletionWindow(ICompletionDataProvider completionDataProvider, char ch)
        {

            try
            {
                codeCompletionWindow = CodeCompletionWindow.ShowCompletionWindow(
                    this,
                    codeEditorControl,
                    "<code>",
                    completionDataProvider,
                    ch);
                if (codeCompletionWindow != null)
                {
                    codeCompletionWindow.Closed += delegate
                                                    {
                                                        _blockKeys = false;
                                                    };

                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }

Upvotes: 2

Related Questions