Type | Description |
Use the ClearBackColor property to clear the node's background color previously defined by the BackColor property. If the node's background color is cleared using the ClearBackColor method the node's background color is defined by the BackColorNode property. Use the BackColor property to specify the control's background.
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