Type | Description | |||
OldNode as Node | A Node object that indicates the previous selected node. | |||
NewNode as Node | A Node object that indicates the currently selected node. |
Use the Select event to notify your application that user changes the selected node. Use the SelectNode property to determine the selected node. Use the Caption property to specify the caption of the node. Use the BackColor property to specify the node's background color. Use the ForeColor property to specify the node's background color. The control automatically scrolls the control's content to ensure that the node being clicked fits the control's client area, if the EnsureVisibleOnSelect property is True.
Syntax for Select event, /NET version, on:
private void Select(object sender,exontrol.EXORGCHARTLib.Node OldNode,exontrol.EXORGCHARTLib.Node NewNode) { } Private Sub Select(ByVal sender As System.Object,ByVal OldNode As exontrol.EXORGCHARTLib.Node,ByVal NewNode As exontrol.EXORGCHARTLib.Node) Handles Select End Sub |
private void Select(object sender, AxEXORGCHARTLib._IChartViewEvents_SelectEvent e) { } void OnSelect(LPDISPATCH OldNode,LPDISPATCH NewNode) { } void __fastcall Select(TObject *Sender,Exorgchartlib_tlb::INode *OldNode,Exorgchartlib_tlb::INode *NewNode) { } procedure Select(ASender: TObject; OldNode : INode;NewNode : INode); begin end; procedure Select(sender: System.Object; e: AxEXORGCHARTLib._IChartViewEvents_SelectEvent); begin end; begin event Select(oleobject OldNode,oleobject NewNode) end event Select Private Sub Select(ByVal sender As System.Object, ByVal e As AxEXORGCHARTLib._IChartViewEvents_SelectEvent) Handles Select End Sub Private Sub Select(ByVal OldNode As EXORGCHARTLibCtl.INode,ByVal NewNode As EXORGCHARTLibCtl.INode) End Sub Private Sub Select(ByVal OldNode As Object,ByVal NewNode As Object) End Sub LPARAMETERS OldNode,NewNode PROCEDURE OnSelect(oChartView,OldNode,NewNode) RETURN |
<SCRIPT EVENT="Select(OldNode,NewNode)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function Select(OldNode,NewNode) End Function </SCRIPT> Procedure OnComSelect Variant llOldNode Variant llNewNode Forward Send OnComSelect llOldNode llNewNode End_Procedure METHOD OCX_Select(OldNode,NewNode) CLASS MainDialog RETURN NIL void onEvent_Select(COM _OldNode,COM _NewNode) { } function Select as v (OldNode as OLE::Exontrol.ChartView.1::INode,NewNode as OLE::Exontrol.ChartView.1::INode) end function function nativeObject_Select(OldNode,NewNode) return |
The following VB sample changes the background and foreground color for the selected node:
Private Sub ChartView1_Select(ByVal OldNode As EXORGCHARTLibCtl.INode, ByVal NewNode As EXORGCHARTLibCtl.INode) If Not (OldNode Is Nothing) Then With OldNode .ClearBackColor .ClearForeColor End With End If With NewNode .ForeColor = vbWhite .BackColor = vbBlue End With End Sub
The following C++ sample changes the background and foreground color for the selected node:
void OnSelectChartview1(LPDISPATCH OldNode, LPDISPATCH NewNode) { CNode oldNode( OldNode ); oldNode.m_bAutoRelease = FALSE; CNode newNode( NewNode ); newNode.m_bAutoRelease = FALSE; if ( oldNode.m_lpDispatch != NULL ) { oldNode.ClearBackColor(); oldNode.ClearForeColor(); } newNode.SetBackColor( RGB(0,0,128) ); newNode.SetForeColor( RGB(255,255,255) ); }
The following VB.NET sample changes the background and foreground color for the selected node:
Private Sub AxChartView1_SelectEvent(ByVal sender As System.Object, ByVal e As AxEXORGCHARTLib._IChartViewEvents_SelectEvent) Handles AxChartView1.SelectEvent If Not (e.oldNode Is Nothing) Then With e.oldNode .ClearBackColor() .ClearForeColor() End With End If With e.newNode .ForeColor = ToUInt32(Color.White) .BackColor = ToUInt32(Color.Blue) End With End Sub
where the ToUInt32 function converts a Color expression to OLE_COLOR,
Shared Function ToUInt32(ByVal c As Color) As UInt32 Dim i As Long i = c.R i = i + 256 * c.G i = i + 256 * 256 * c.B ToUInt32 = Convert.ToUInt32(i) End Function
The following C# sample changes the background and foreground color for the selected node:
private void axChartView1_SelectEvent(object sender, AxEXORGCHARTLib._IChartViewEvents_SelectEvent e) { if ( e.oldNode != null ) { e.oldNode.ClearBackColor(); e.oldNode.ClearForeColor(); } e.newNode.BackColor = ToUInt32(Color.Blue); e.newNode.ForeColor = ToUInt32(Color.White); }
where the ToUInt32 function converts a Color expression to OLE_COLOR,
private UInt32 ToUInt32(Color c) { long i; i = c.R; i = i + 256 * c.G; i = i + 256 * 256 * c.B; return Convert.ToUInt32(i); }
The following VFP sample changes the background and foreground color for the selected node:
*** ActiveX Control Event *** LPARAMETERS oldnode, newnode If !isnull(oldnode) With oldnode .ClearBackColor .ClearForeColor EndWith EndIf With newnode .ForeColor = RGB(255,255,255) .BackColor = RGB(0,0,128) EndWith