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 Gantt1 .Columns.Add "Default" With .Items h = .AddItem("Root") hC = .InsertItem(h,0,"Child 1") Gantt1.Chart.ItemBackColor(hC) = RGB(255,0,0) .InsertItem h,0,"Child 2" .ExpandItem(h) = True End With End With
VB6
With Gantt1 .Columns.Add "Default" With .Items h = .AddItem("Root") hC = .InsertItem(h,0,"Child 1") Gantt1.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 Exgantt1 .Columns.Add("Default") With .Items h = .AddItem("Root") hC = .InsertItem(h,0,"Child 1") Exgantt1.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 AxGantt1 .Columns.Add("Default") With .Items h = .AddItem("Root") hC = .InsertItem(h,0,"Child 1") AxGantt1.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 'EXGANTTLib' for the library: 'ExGantt 1.0 Control Library' #import <ExGantt.dll> using namespace EXGANTTLib; */ EXGANTTLib::IGanttPtr spGantt1 = GetDlgItem(IDC_GANTT1)->GetControlUnknown(); spGantt1->GetColumns()->Add(L"Default"); EXGANTTLib::IItemsPtr var_Items = spGantt1->GetItems(); long h = var_Items->AddItem("Root"); long hC = var_Items->InsertItem(h,long(0),"Child 1"); spGantt1->GetChart()->PutItemBackColor(hC,RGB(255,0,0)); var_Items->InsertItem(h,long(0),"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE);
C#
exgantt1.Columns.Add("Default"); exontrol.EXGANTTLib.Items var_Items = exgantt1.Items; int h = var_Items.AddItem("Root"); int hC = var_Items.InsertItem(h,0,"Child 1"); exgantt1.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
axGantt1.Columns.Add("Default"); EXGANTTLib.Items var_Items = axGantt1.Items; int h = var_Items.AddItem("Root"); int hC = var_Items.InsertItem(h,0,"Child 1"); axGantt1.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 AxGantt1 do begin Columns.Add('Default'); with Items do begin h := AddItem('Root'); hC := InsertItem(h,TObject(0),'Child 1'); AxGantt1.Chart.ItemBackColor[hC] := $ff; InsertItem(h,TObject(0),'Child 2'); ExpandItem[h] := True; end; end
Delphi (standard)
with Gantt1 do begin Columns.Add('Default'); with Items do begin h := AddItem('Root'); hC := InsertItem(h,OleVariant(0),'Child 1'); Gantt1.Chart.ItemBackColor[hC] := $ff; InsertItem(h,OleVariant(0),'Child 2'); ExpandItem[h] := True; end; end
VFP
with thisform.Gantt1 .Columns.Add("Default") with .Items h = .AddItem("Root") hC = .InsertItem(h,0,"Child 1") thisform.Gantt1.Chart.ItemBackColor(hC) = RGB(255,0,0) .InsertItem(h,0,"Child 2") .ExpandItem(h) = .T. endwith endwith