我们正在使用Syncfusion的Essential Studio for Windows窗体。 目前我正在使用一个使用EditControl的pascal的小代码编辑器。在键入我们刚刚定义的词汇(例如“。”)之后,就会启动类似autoComplete功能的IntelliSense,并为我们提供API的所有已定义方法。好的。
但是我们需要在按下按钮 CTRL + SPACE 并向我们显示所有api方法后打开自动完成对话框,无论是否我们输入了一个lexem。因为Pascal没有任何OOP,这是唯一合理的方式。
这怎么可能?
Greez Chris
答案 0 :(得分:1)
查询:如何在按STRG + Space后打开上下文选项?
请在STRG + Space
之后使用以下代码和示例打开ContextChoice列表Code [C#]:
// Adds "<?" word processing for global context.
ConfigLexem lexemId = GetConfigLexem((IConfigLexem)editControl1.Language, "STRG");
lexemId.Type = FormatType.Text;
// "<?" starts it`s own context. It does not have EndBlock specified, so the first unprocessed token will force parser to exit from "this"'s context.
lexemId.IsComplex = true;
//To open the Context Choice after space
ConfigLexem lexemQues = GetConfigLexem((IConfigLexem)lexemId, " ");
lexemQues.Type = FormatType.Operator;
// "?" can drop context choice list
lexemQues.DropContextChoiceList = true;
lexemQues.IsComplex = true;
Code[VB]:
' Adds "<?" word processing for global context.
Dim lexemId As ConfigLexem = GetConfigLexem(CType(editControl1.Language, IConfigLexem), "STRG")
lexemId.Type = FormatType.Text
' "<?" starts it`s own context. It does not have EndBlock specified, so the first unprocessed token will force parser to exit from "this"'s context.
lexemId.IsComplex = True
'To open the Context Choice after space
Dim lexemQues As ConfigLexem = GetConfigLexem(CType(lexemId, IConfigLexem), `enter code here`" ")
lexemQues.Type = FormatType.Operator
' "?" can drop context choice list
lexemQues.DropContextChoiceList = True
lexemQues.IsComplex = True
示例C#:http://www.syncfusion.com/downloads/support/directtrac/general/ze/EditControl_Intellisense1331161585
示例VB:http://www.syncfusion.com/downloads/support/directtrac/general/ze/EditControlVb-143548194
注意:我为Syncfusion工作