![]() | Type | Description | ||
| Object as Object | An object created by UserEditor property. | |||
| Ev as OleEvent | An OleEvent object that holds information about the event | |||
| CloseEditor as Boolean | A boolean expression that indicates whether the control should close the user editor. | |||
| Node as Node | A Node object where the ActiveX editor is opened. |
The following VB sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:
Private Sub XMLGrid1_UserEditorOleEvent(ByVal Object As Object, ByVal Ev As EXMLGRIDLibCtl.IOleEvent, CloseEditor As Boolean, ByVal Node As EXMLGRIDLibCtl.INode)
If (Ev.Name = "Change") Then
Node.Value = Object.Select(0)
CloseEditor = True
End If
If (Ev.Name = "KeyPress") Then
Dim l As Long
l = Ev(0).Value
If l = vbKeyEscape Then
CloseEditor = True
End If
End If
End Sub
the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ):
The following C++ sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:
#import <exmlgrid.dll>
#import <excombobox.dll>
void OnUserEditorOleEventXmlgrid1(LPDISPATCH Object, LPDISPATCH Ev, BOOL FAR* CloseEditor, LPDISPATCH Node)
{
EXMLGRIDLib::IOleEventPtr spEvent = Ev;
EXCOMBOBOXLib::IComboBoxPtr spComboBox = Object;
if ( spComboBox != NULL )
if ( spEvent != NULL )
{
if ( spEvent->Name.operator ==( "Change" ) )
{
CNode node( Node );
node.SetValue( spComboBox->GetSelect( COleVariant( (long)0 ) ) );
*CloseEditor = TRUE;
}
else
if ( spEvent->Name.operator ==( "KeyPress" ) )
{
// gets the KeyCode parameter
EXMLGRIDLib::IOleEventParamPtr spParam;
if ( SUCCEEDED( spEvent->get_Param( COleVariant( (long)0 ), &spParam ) ) )
{
COleVariant vtI4;
vtI4.ChangeType( VT_I4, &spParam->Value );
if ( V_I4( &vtI4) == VK_ESCAPE )
*CloseEditor = TRUE;
}
}
}
}
the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ), so we need to call the #import <excombobox.dll> in order to include definitions for objects and types in the ExComboBox control. The #import <excombobox.dll> creates EXCOMBOBOXLib namespace that includes all definitions for objects and types that the ExComboBox control exports.
The following VB.NET sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:
Private Sub AxXMLGrid1_UserEditorOleEvent(ByVal sender As Object, ByVal e As AxEXMLGRIDLib._IXMLGridEvents_UserEditorOleEventEvent) Handles AxXMLGrid1.UserEditorOleEvent
If (e.ev.Name = "Change") Then
e.node.Value = e.object.Select(0)
e.closeEditor = True
End If
If (e.ev.Name = "KeyPress") Then
Dim l As Integer = e.ev(0).Value
If l = Keys.Escape Then
e.closeEditor = True
End If
End If
End Sub
the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ):
The following C# sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:
private void axXMLGrid1_UserEditorOleEvent(object sender, AxEXMLGRIDLib._IXMLGridEvents_UserEditorOleEventEvent e)
{
if (e.ev.Name == "Change")
{
EXCOMBOBOXLib.ComboBox comboBox = e.@object as EXCOMBOBOXLib.ComboBox;
if ( comboBox != null )
e.node.Value = comboBox.get_Select(0);
e.closeEditor = true;
}
else
if (e.ev.Name == "KeyPress")
{
if (Convert.ToInt16(e.ev[0].Value) == Convert.ToInt16(Keys.Escape))
e.closeEditor = true;
}
}
the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ):
In C# your project needs a new reference to the Exontrol's ExComboBox control library. Use the Project\Add Reference\COM item to add new reference to a COM object. Once that you added a reference to the Exontrol's ExComboBox the EXCOMBOBOXLib namespace is created. The EXCOMBOBOXLib namespace contains definitions for all objects that ExComboBox control exports.
The following VFP sample closes the Exontrol's ExComboBox user editor when the user selects a new value, or when it presses the Escape key. Also the sample changes the value of the node in the ExComboBox control:
*** ActiveX Control Event ***
LPARAMETERS object, ev, closeeditor, node
If (ev.Name = "Change") Then
node.Value = object.Select(0)
closeeditor = .t.
else
If (ev.Name = "KeyPress") Then
local l
l = Ev(0).Value
If l = 27 Then
closeeditor = .t.
EndIf
EndIf
EndIf
the sample requires an ActiveX editor ( in our case the Exontrol's ExComboBox control ):