event ButtonClick (Node as Node, Key as Variant)
Occurs when user clicks on the cell's button.

TypeDescription
Node as Node A Node object being clicked.
Key as Variant A Variant expression that indicates the key of the button inside the node being clicked.
Use the ButtonClick event to notify your application that the user clicks a button inside a node. Use the AddButton method to add new buttons to an editor. Use the Editors property to access the control's Editors collection. Use the Add method to add new type of editors to the control. Use the Editor property to assign an editor to a node.

Syntax for ButtonClick event, /NET version, on:

private void ButtonClick(object sender,exontrol.EXMLGRIDLib.Node Node,object Key)
{
}

Private Sub ButtonClick(ByVal sender As System.Object,ByVal Node As exontrol.EXMLGRIDLib.Node,ByVal Key As Object) Handles ButtonClick
End Sub

Syntax for ButtonClick event, /COM version, on:

private void ButtonClick(object sender, AxEXMLGRIDLib._IXMLGridEvents_ButtonClickEvent e)
{
}

void OnButtonClick(LPDISPATCH Node,VARIANT Key)
{
}

void __fastcall ButtonClick(TObject *Sender,Exmlgridlib_tlb::INode *Node,Variant Key)
{
}

procedure ButtonClick(ASender: TObject; Node : INode;Key : OleVariant);
begin
end;

procedure ButtonClick(sender: System.Object; e: AxEXMLGRIDLib._IXMLGridEvents_ButtonClickEvent);
begin
end;

begin event ButtonClick(oleobject Node,any Key)
end event ButtonClick

Private Sub ButtonClick(ByVal sender As System.Object, ByVal e As AxEXMLGRIDLib._IXMLGridEvents_ButtonClickEvent) Handles ButtonClick
End Sub

Private Sub ButtonClick(ByVal Node As EXMLGRIDLibCtl.INode,ByVal Key As Variant)
End Sub

Private Sub ButtonClick(ByVal Node As Object,ByVal Key As Variant)
End Sub

LPARAMETERS Node,Key

PROCEDURE OnButtonClick(oXMLGrid,Node,Key)
RETURN

Syntax for ButtonClick event, /COM version (others), on:

<SCRIPT EVENT="ButtonClick(Node,Key)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function ButtonClick(Node,Key)
End Function
</SCRIPT>

Procedure OnComButtonClick Variant llNode Variant llKey
	Forward Send OnComButtonClick llNode llKey
End_Procedure

METHOD OCX_ButtonClick(Node,Key) CLASS MainDialog
RETURN NIL

void onEvent_ButtonClick(COM _Node,COMVariant _Key)
{
}

function ButtonClick as v (Node as OLE::Exontrol.XMLGrid.1::INode,Key as A)
end function

function nativeObject_ButtonClick(Node,Key)
return

The following VB sample displays a message box when user clicks the 'A' button:

Private Sub Form_Load()
    With XMLGrid1
        .BeginUpdate
            With .Editors
                With .Add("Spin", SpinType)
                    .ButtonWidth = 18
                    .AddButton "A", 1
                End With
            End With
            With .Nodes
                With .Add("Spin", 1)
                    .Editor = "Spin"
                End With
            End With
        .EndUpdate
    End With
End Sub

Private Sub XMLGrid1_ButtonClick(ByVal Node As EXMLGRIDLibCtl.INode, ByVal Key As Variant)
    If Key = "A" Then
        MsgBox "You have clicked the 'A' button."
    End If
End Sub

The following C++ sample displays a message box when user clicks the 'A' button:

#include "Node.h"
void OnButtonClickXmlgrid1(LPDISPATCH Node, const VARIANT FAR& Key) 
{
	CNode node( Node ); node.m_bAutoRelease = FALSE;
	if ( V2S( &Key ) == "A" )
		MessageBox( "Click the button" ) ;
}

where the VS2 function converts a VARIANT expression to a string expression:

static CString V2S( const VARIANT* pvtValue )
{
	COleVariant vtString;
	vtString.ChangeType( VT_BSTR, (VARIANT*)pvtValue );
	return V_BSTR( &vtString );
}

The following VB.NET sample displays a message box when user clicks the 'A' button:

Private Sub AxXMLGrid1_ButtonClick(ByVal sender As Object, ByVal e As AxEXMLGRIDLib._IXMLGridEvents_ButtonClickEvent) Handles AxXMLGrid1.ButtonClick
    If e.key = "A" Then
        MsgBox("You have clicked the 'A' button.")
    End If
End Sub

The following C# sample displays a message box when user clicks the 'A' button:

private void axXMLGrid1_ButtonClick(object sender, AxEXMLGRIDLib._IXMLGridEvents_ButtonClickEvent e)
{
	if (e.key.ToString() == "A")
		MessageBox.Show("The user clicks the 'A' button. ");
}

The following VFP sample displays a message box when user clicks the 'A' button:

*** ActiveX Control Event ***
LPARAMETERS node, key

if ( key = "A" )
	wait window nowait "The uuser clicks the 'A' button. "
endif