Type | Description | |||
Item as HITEM | A long expression that indicates the handle of the item. | |||
Color | A color expression that indicates the item's background color. The last 7 bits in the high significant byte of the color to indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the |
The following screen shot shows the chart part when using the ItemBackColor property of the Chart object:
The following samples changes the background color for the item in the chart part only.
VBA (MS Access, Excell...)
With G2antt1 .Columns.Add "Default" With .Items h = .AddItem("Root") hC = .InsertItem(h,0,"Child 1") G2antt1.Chart.ItemBackColor(hC) = RGB(255,0,0) .InsertItem h,0,"Child 2" .ExpandItem(h) = True End With End With
VB6
With G2antt1 .Columns.Add "Default" With .Items h = .AddItem("Root") hC = .InsertItem(h,0,"Child 1") G2antt1.Chart.ItemBackColor(hC) = RGB(255,0,0) .InsertItem h,0,"Child 2" .ExpandItem(h) = True End With End With
VB.NET
Dim h,hC With Exg2antt1 .Columns.Add("Default") With .Items h = .AddItem("Root") hC = .InsertItem(h,0,"Child 1") Exg2antt1.Chart.set_ItemBackColor(hC,Color.FromArgb(255,0,0)) .InsertItem(h,0,"Child 2") .set_ExpandItem(h,True) End With End With
VB.NET for /COM
Dim h,hC With AxG2antt1 .Columns.Add("Default") With .Items h = .AddItem("Root") hC = .InsertItem(h,0,"Child 1") AxG2antt1.Chart.ItemBackColor(hC) = RGB(255,0,0) .InsertItem(h,0,"Child 2") .ExpandItem(h) = True End With End With
C++
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetColumns()->Add(L"Default"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root"); long hC = var_Items->InsertItem(h,long(0),"Child 1"); spG2antt1->GetChart()->PutItemBackColor(hC,RGB(255,0,0)); var_Items->InsertItem(h,long(0),"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE);
C#
exg2antt1.Columns.Add("Default"); exontrol.EXG2ANTTLib.Items var_Items = exg2antt1.Items; int h = var_Items.AddItem("Root"); int hC = var_Items.InsertItem(h,0,"Child 1"); exg2antt1.Chart.set_ItemBackColor(hC,Color.FromArgb(255,0,0)); var_Items.InsertItem(h,0,"Child 2"); var_Items.set_ExpandItem(h,true);
C# for /COM
axG2antt1.Columns.Add("Default"); EXG2ANTTLib.Items var_Items = axG2antt1.Items; int h = var_Items.AddItem("Root"); int hC = var_Items.InsertItem(h,0,"Child 1"); axG2antt1.Chart.set_ItemBackColor(hC,(uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0))); var_Items.InsertItem(h,0,"Child 2"); var_Items.set_ExpandItem(h,true);
Delphi 8 (.NET only)
with AxG2antt1 do begin Columns.Add('Default'); with Items do begin h := AddItem('Root'); hC := InsertItem(h,TObject(0),'Child 1'); AxG2antt1.Chart.ItemBackColor[hC] := $ff; InsertItem(h,TObject(0),'Child 2'); ExpandItem[h] := True; end; end
Delphi (standard)
with G2antt1 do begin Columns.Add('Default'); with Items do begin h := AddItem('Root'); hC := InsertItem(h,OleVariant(0),'Child 1'); G2antt1.Chart.ItemBackColor[hC] := $ff; InsertItem(h,OleVariant(0),'Child 2'); ExpandItem[h] := True; end; end
VFP
with thisform.G2antt1 .Columns.Add("Default") with .Items h = .AddItem("Root") hC = .InsertItem(h,0,"Child 1") thisform.G2antt1.Chart.ItemBackColor(hC) = RGB(255,0,0) .InsertItem(h,0,"Child 2") .ExpandItem(h) = .T. endwith endwith