Type | Description | |||
Context as Variant | A string expression that defines the current context. |
How can I provide different sensitive context?
VBA (MS Access, Excell...)
' Change event - Indicates that the control's text have changed. Private Sub Edit1_Change() With Edit1 .ShowContext .ChangeOnKey End With End Sub With Edit1 .Text = "" .InsertText "Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context" With .Context() .Add "General_1" .Add "General_2" End With With .Context("46") .Add "Property_1" .Add "Property_2" .Add "Property_3" End With With .Context("58") .Add "Method_1" .Add "Method_2" .Add "Method_3" End With End With
VB6
' Change event - Indicates that the control's text have changed. Private Sub Edit1_Change() With Edit1 .ShowContext .ChangeOnKey End With End Sub With Edit1 .Text = "" .InsertText "Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context" With .Context() .Add "General_1" .Add "General_2" End With With .Context("46") .Add "Property_1" .Add "Property_2" .Add "Property_3" End With With .Context("58") .Add "Method_1" .Add "Method_2" .Add "Method_3" End With End With
VB.NET
' Change event - Indicates that the control's text have changed. Private Sub Exedit1_Change(ByVal sender As System.Object) Handles Exedit1.Change With Exedit1 .ShowContext(.ChangeOnKey) End With End Sub With Exedit1 .Text = "" .InsertText("Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context") With .get_Context() .Add("General_1") .Add("General_2") End With With .get_Context("46") .Add("Property_1") .Add("Property_2") .Add("Property_3") End With With .get_Context("58") .Add("Method_1") .Add("Method_2") .Add("Method_3") End With End With
VB.NET for /COM
' Change event - Indicates that the control's text have changed. Private Sub AxEdit1_Change(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxEdit1.Change With AxEdit1 .ShowContext(.ChangeOnKey) End With End Sub With AxEdit1 .Text = "" .InsertText("Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context") With .get_Context() .Add("General_1") .Add("General_2") End With With .get_Context("46") .Add("Property_1") .Add("Property_2") .Add("Property_3") End With With .get_Context("58") .Add("Method_1") .Add("Method_2") .Add("Method_3") End With End With
C++
// Change event - Indicates that the control's text have changed. void OnChangeEdit1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXEDITLib' for the library: 'ExEdit 1.0 Control Library' #import <ExEdit.dll> using namespace EXEDITLib; */ EXEDITLib::IEditPtr spEdit1 = GetDlgItem(IDC_EDIT1)->GetControlUnknown(); spEdit1->ShowContext(spEdit1->GetChangeOnKey()); } EXEDITLib::IEditPtr spEdit1 = GetDlgItem(IDC_EDIT1)->GetControlUnknown(); spEdit1->PutText(L""); spEdit1->InsertText(L"Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context",vtMissing); EXEDITLib::IEditContextPtr var_Context = spEdit1->GetContext(vtMissing); var_Context->Add(L"General_1",vtMissing,vtMissing,vtMissing); var_Context->Add(L"General_2",vtMissing,vtMissing,vtMissing); EXEDITLib::IEditContextPtr var_Context1 = spEdit1->GetContext("46"); var_Context1->Add(L"Property_1",vtMissing,vtMissing,vtMissing); var_Context1->Add(L"Property_2",vtMissing,vtMissing,vtMissing); var_Context1->Add(L"Property_3",vtMissing,vtMissing,vtMissing); EXEDITLib::IEditContextPtr var_Context2 = spEdit1->GetContext("58"); var_Context2->Add(L"Method_1",vtMissing,vtMissing,vtMissing); var_Context2->Add(L"Method_2",vtMissing,vtMissing,vtMissing); var_Context2->Add(L"Method_3",vtMissing,vtMissing,vtMissing);
C++ Builder
// Change event - Indicates that the control's text have changed. void __fastcall TForm1::Edit1Change(TObject *Sender) { Edit1->ShowContext(TVariant(Edit1->ChangeOnKey)); } Edit1->Text = L""; Edit1->InsertText(L"Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context",TNoParam()); Exeditlib_tlb::IEditContextPtr var_Context = Edit1->Context[TNoParam()]; var_Context->Add(L"General_1",TNoParam(),TNoParam(),TNoParam()); var_Context->Add(L"General_2",TNoParam(),TNoParam(),TNoParam()); Exeditlib_tlb::IEditContextPtr var_Context1 = Edit1->Context[TVariant("46")]; var_Context1->Add(L"Property_1",TNoParam(),TNoParam(),TNoParam()); var_Context1->Add(L"Property_2",TNoParam(),TNoParam(),TNoParam()); var_Context1->Add(L"Property_3",TNoParam(),TNoParam(),TNoParam()); Exeditlib_tlb::IEditContextPtr var_Context2 = Edit1->Context[TVariant("58")]; var_Context2->Add(L"Method_1",TNoParam(),TNoParam(),TNoParam()); var_Context2->Add(L"Method_2",TNoParam(),TNoParam(),TNoParam()); var_Context2->Add(L"Method_3",TNoParam(),TNoParam(),TNoParam());
C#
// Change event - Indicates that the control's text have changed. private void exedit1_Change(object sender) { exedit1.ShowContext(exedit1.ChangeOnKey); } //this.exedit1.Change += new exontrol.EXEDITLib.exg2antt.ChangeEventHandler(this.exedit1_Change); exedit1.Text = ""; exedit1.InsertText("Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context",null); exontrol.EXEDITLib.Context var_Context = exedit1.get_Context(null); var_Context.Add("General_1",null,null,null); var_Context.Add("General_2",null,null,null); exontrol.EXEDITLib.Context var_Context1 = exedit1.get_Context("46"); var_Context1.Add("Property_1",null,null,null); var_Context1.Add("Property_2",null,null,null); var_Context1.Add("Property_3",null,null,null); exontrol.EXEDITLib.Context var_Context2 = exedit1.get_Context("58"); var_Context2.Add("Method_1",null,null,null); var_Context2.Add("Method_2",null,null,null); var_Context2.Add("Method_3",null,null,null);
JScript/JavaScript
<BODY onload="Init()"> <SCRIPT FOR="Edit1" EVENT="Change()" LANGUAGE="JScript"> Edit1.ShowContext(Edit1.ChangeOnKey); </SCRIPT> <OBJECT CLASSID="clsid:39136531-DD0F-4281-B445-E36FC2CDDBC5" id="Edit1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { Edit1.Text = ""; Edit1.InsertText("Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context",null); var var_Context = Edit1.Context(null); var_Context.Add("General_1",null,null,null); var_Context.Add("General_2",null,null,null); var var_Context1 = Edit1.Context("46"); var_Context1.Add("Property_1",null,null,null); var_Context1.Add("Property_2",null,null,null); var_Context1.Add("Property_3",null,null,null); var var_Context2 = Edit1.Context("58"); var_Context2.Add("Method_1",null,null,null); var_Context2.Add("Method_2",null,null,null); var_Context2.Add("Method_3",null,null,null); } </SCRIPT> </BODY>
VBScript
<BODY onload="Init()"> <SCRIPT LANGUAGE="VBScript"> Function Edit1_Change() With Edit1 .ShowContext .ChangeOnKey End With End Function </SCRIPT> <OBJECT CLASSID="clsid:39136531-DD0F-4281-B445-E36FC2CDDBC5" id="Edit1"></OBJECT> <SCRIPT LANGUAGE="VBScript"> Function Init() With Edit1 .Text = "" .InsertText "Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context" With .Context() .Add "General_1" .Add "General_2" End With With .Context("46") .Add "Property_1" .Add "Property_2" .Add "Property_3" End With With .Context("58") .Add "Method_1" .Add "Method_2" .Add "Method_3" End With End With End Function </SCRIPT> </BODY>
C# for /COM
// Change event - Indicates that the control's text have changed. private void axEdit1_Change(object sender, EventArgs e) { axEdit1.ShowContext(axEdit1.ChangeOnKey); } //this.axEdit1.Change += new EventHandler(this.axEdit1_Change); axEdit1.Text = ""; axEdit1.InsertText("Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context",null); EXEDITLib.Context var_Context = axEdit1.get_Context(null); var_Context.Add("General_1",null,null,null); var_Context.Add("General_2",null,null,null); EXEDITLib.Context var_Context1 = axEdit1.get_Context("46"); var_Context1.Add("Property_1",null,null,null); var_Context1.Add("Property_2",null,null,null); var_Context1.Add("Property_3",null,null,null); EXEDITLib.Context var_Context2 = axEdit1.get_Context("58"); var_Context2.Add("Method_1",null,null,null); var_Context2.Add("Method_2",null,null,null); var_Context2.Add("Method_3",null,null,null);
X++ (Dynamics Ax 2009)
// Change event - Indicates that the control's text have changed. void onEvent_Change() { ; exedit1.ShowContext(exedit1.ChangeOnKey()); } public void init() { COM com_Context,com_Context1,com_Context2; anytype var_Context,var_Context1,var_Context2; ; super(); exedit1.Text(""); exedit1.InsertText("Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context"); var_Context = exedit1.Context(); com_Context = var_Context; com_Context.Add("General_1"); com_Context.Add("General_2"); var_Context1 = exedit1.Context("46"); com_Context1 = var_Context1; com_Context1.Add("Property_1"); com_Context1.Add("Property_2"); com_Context1.Add("Property_3"); var_Context2 = exedit1.Context("58"); com_Context2 = var_Context2; com_Context2.Add("Method_1"); com_Context2.Add("Method_2"); com_Context2.Add("Method_3"); }
Delphi 8 (.NET only)
// Change event - Indicates that the control's text have changed. procedure TWinForm1.AxEdit1_Change(sender: System.Object; e: System.EventArgs); begin with AxEdit1 do begin ShowContext(TObject(ChangeOnKey)); end end; with AxEdit1 do begin Text := ''; InsertText('Press .(dot), :(colon) or CTRL + SPACE to invoke the control''s context',Nil); with get_Context(Nil) do begin Add('General_1',Nil,Nil,Nil); Add('General_2',Nil,Nil,Nil); end; with get_Context('46') do begin Add('Property_1',Nil,Nil,Nil); Add('Property_2',Nil,Nil,Nil); Add('Property_3',Nil,Nil,Nil); end; with get_Context('58') do begin Add('Method_1',Nil,Nil,Nil); Add('Method_2',Nil,Nil,Nil); Add('Method_3',Nil,Nil,Nil); end; end
Delphi (standard)
// Change event - Indicates that the control's text have changed. procedure TForm1.Edit1Change(ASender: TObject; ); begin with Edit1 do begin ShowContext(OleVariant(ChangeOnKey)); end end; with Edit1 do begin Text := ''; InsertText('Press .(dot), :(colon) or CTRL + SPACE to invoke the control''s context',Null); with Context[Null] do begin Add('General_1',Null,Null,Null); Add('General_2',Null,Null,Null); end; with Context['46'] do begin Add('Property_1',Null,Null,Null); Add('Property_2',Null,Null,Null); Add('Property_3',Null,Null,Null); end; with Context['58'] do begin Add('Method_1',Null,Null,Null); Add('Method_2',Null,Null,Null); Add('Method_3',Null,Null,Null); end; end
VFP
*** Change event - Indicates that the control's text have changed. *** LPARAMETERS nop with thisform.Edit1 .ShowContext(.ChangeOnKey) endwith with thisform.Edit1 .Text = "" .InsertText("Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context") with .Context() .Add("General_1") .Add("General_2") endwith with .Context("46") .Add("Property_1") .Add("Property_2") .Add("Property_3") endwith with .Context("58") .Add("Method_1") .Add("Method_2") .Add("Method_3") endwith endwith
dBASE Plus
/* with (this.EXEDITACTIVEXCONTROL1.nativeObject) Change = class::nativeObject_Change endwith */ // Indicates that the control's text have changed. function nativeObject_Change() oEdit = form.EXEDITACTIVEXCONTROL1.nativeObject oEdit.ShowContext(oEdit.ChangeOnKey) return local oEdit,var_Context,var_Context1,var_Context2 oEdit = form.EXEDITACTIVEXCONTROL1.nativeObject oEdit.Text = "" oEdit.InsertText("Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context") var_Context = oEdit.Context() var_Context.Add("General_1") var_Context.Add("General_2") var_Context1 = oEdit.Context("46") var_Context1.Add("Property_1") var_Context1.Add("Property_2") var_Context1.Add("Property_3") var_Context2 = oEdit.Context("58") var_Context2.Add("Method_1") var_Context2.Add("Method_2") var_Context2.Add("Method_3")
XBasic (Alpha Five)
' Indicates that the control's text have changed. function Change as v () oEdit = topparent:CONTROL_ACTIVEX1.activex oEdit.ShowContext(oEdit.ChangeOnKey) end function Dim oEdit as P Dim var_Context as P Dim var_Context1 as P Dim var_Context2 as P oEdit = topparent:CONTROL_ACTIVEX1.activex oEdit.Text = "" oEdit.InsertText("Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context") var_Context = oEdit.Context() var_Context.Add("General_1") var_Context.Add("General_2") var_Context1 = oEdit.Context("46") var_Context1.Add("Property_1") var_Context1.Add("Property_2") var_Context1.Add("Property_3") var_Context2 = oEdit.Context("58") var_Context2.Add("Method_1") var_Context2.Add("Method_2") var_Context2.Add("Method_3")
Visual Objects
METHOD OCX_Exontrol1Change() CLASS MainDialog // Change event - Indicates that the control's text have changed. oDCOCX_Exontrol1:ShowContext(oDCOCX_Exontrol1:ChangeOnKey) RETURN NIL local var_Context,var_Context1,var_Context2 as IEditContext oDCOCX_Exontrol1:Text := "" oDCOCX_Exontrol1:InsertText("Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context",nil) var_Context := oDCOCX_Exontrol1:[Context,nil] var_Context:Add("General_1",nil,nil,nil) var_Context:Add("General_2",nil,nil,nil) var_Context1 := oDCOCX_Exontrol1:[Context,"46"] var_Context1:Add("Property_1",nil,nil,nil) var_Context1:Add("Property_2",nil,nil,nil) var_Context1:Add("Property_3",nil,nil,nil) var_Context2 := oDCOCX_Exontrol1:[Context,"58"] var_Context2:Add("Method_1",nil,nil,nil) var_Context2:Add("Method_2",nil,nil,nil) var_Context2:Add("Method_3",nil,nil,nil)
PowerBuilder
/*begin event Change() - Indicates that the control's text have changed.*/ /* oEdit = ole_1.Object oEdit.ShowContext(oEdit.ChangeOnKey) */ /*end event Change*/ OleObject oEdit,var_Context,var_Context1,var_Context2 oEdit = ole_1.Object oEdit.Text = "" oEdit.InsertText("Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context") var_Context = oEdit.Context() var_Context.Add("General_1") var_Context.Add("General_2") var_Context1 = oEdit.Context("46") var_Context1.Add("Property_1") var_Context1.Add("Property_2") var_Context1.Add("Property_3") var_Context2 = oEdit.Context("58") var_Context2.Add("Method_1") var_Context2.Add("Method_2") var_Context2.Add("Method_3")
Visual DataFlex
// Indicates that the control's text have changed. Procedure OnComChange Forward Send OnComChange Send ComShowContext (ComChangeOnKey(Self)) End_Procedure Procedure OnCreate Forward Send OnCreate Set ComText to "" Send ComInsertText "Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context" Nothing Variant voContext Get ComContext Nothing to voContext Handle hoContext Get Create (RefClass(cComContext)) to hoContext Set pvComObject of hoContext to voContext Send ComAdd of hoContext "General_1" Nothing Nothing Nothing Send ComAdd of hoContext "General_2" Nothing Nothing Nothing Send Destroy to hoContext Variant voContext1 Get ComContext "46" to voContext1 Handle hoContext1 Get Create (RefClass(cComContext)) to hoContext1 Set pvComObject of hoContext1 to voContext1 Send ComAdd of hoContext1 "Property_1" Nothing Nothing Nothing Send ComAdd of hoContext1 "Property_2" Nothing Nothing Nothing Send ComAdd of hoContext1 "Property_3" Nothing Nothing Nothing Send Destroy to hoContext1 Variant voContext2 Get ComContext "58" to voContext2 Handle hoContext2 Get Create (RefClass(cComContext)) to hoContext2 Set pvComObject of hoContext2 to voContext2 Send ComAdd of hoContext2 "Method_1" Nothing Nothing Nothing Send ComAdd of hoContext2 "Method_2" Nothing Nothing Nothing Send ComAdd of hoContext2 "Method_3" Nothing Nothing Nothing Send Destroy to hoContext2 End_Procedure
XBase++
PROCEDURE OnChange(oEdit) oEdit:ShowContext(oEdit:ChangeOnKey()) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oEdit LOCAL oContext,oContext1,oContext2 oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oEdit := XbpActiveXControl():new( oForm:drawingArea ) oEdit:CLSID := "Exontrol.Edit.1" /*{39136531-DD0F-4281-B445-E36FC2CDDBC5}*/ oEdit:create(,, {10,60},{610,370} ) oEdit:Change := {|| OnChange(oEdit)} /*Indicates that the control's text have changed.*/ oEdit:Text := "" oEdit:InsertText("Press .(dot), :(colon) or CTRL + SPACE to invoke the control's context") oContext := oEdit:Context() oContext:Add("General_1") oContext:Add("General_2") oContext1 := oEdit:Context("46") oContext1:Add("Property_1") oContext1:Add("Property_2") oContext1:Add("Property_3") oContext2 := oEdit:Context("58") oContext2:Add("Method_1") oContext2:Add("Method_2") oContext2:Add("Method_3") oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN