Articles in this section
Category / Section

How to create intellisense function in WinForms SyntaxEditor (EditControl)?

1 min read

Intellisense function

The Intellisence function can be implemented in EditControl by handling the ContextChoiceOpen Events. Through this event, you can add the list of items, like methods and properties, to the Context Menu. The list can be added to the Context Menu using the following code snippets.

C#

private void editControl1_ContextChoiceOpen(IContextChoiceController controller)
{
    //Gets the list of Method and Property configurations for current context.
    ICollection list = GetList();
    int imageIndex = 0;
    //Adds configuration BeginBlocks and associated descriptions to the Context Choice List.
    foreach (IConfigLexem conf in list)
    {
        controller.Items.Add(conf.BeginBlock, (string)m_MethodComments[conf.ID], this.editControl1.ContextChoiceController.Images["Image" + imageIndex.ToString()]);
        imageIndex++;
    }
}

VB

Private Sub editControl1_ContextChoiceOpen(ByVal controller As IContextChoiceController) Handles editControl1.ContextChoiceOpen
   'Gets the list of Method and Property configurations for current context.
    Dim list As ICollection = GetList()
    Dim imageIndex As Integer = 0
    'Adds configuration BeginBlocks and associated descriptions to the Context Choice List.
    For Each conf As IConfigLexem In list
        controller.Items.Add(conf.BeginBlock, CStr(m_MethodComments(conf.ID)), Me.editControl1.ContextChoiceController.Images("Image" & imageIndex.ToString()))
        imageIndex += 1
    Next conf
End Sub

Sample:

https://www.syncfusion.com/downloads/support/directtrac/general/Intellisence_function-298910315.zip

Reference link: https://help.syncfusion.com/windowsforms/syntax-editor/intellisense#populate-intellisense-pop-up

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied