property InsideZoom.Width as Long
Specifies the width of the date/time in the chart.

 TypeDescription 
   Long A long expression that specifies the width in pixels, of the date-time unit.  
The Width property defines the width in pixels of the unit being shown in the levels area. By default, the Width property is indicated by the DefaultWidth property ( by default 128 ). Use the Width property to specify the width of the unit in the level area. The AllowResize property specifies whether the unit is resizable, ie the resizing cursor shows up when the cursor hovers the unit. You can use Width property on 0 to hide a specified unit. Use the CondInsideZoom property to specify a formula to define the time units that may be resized if the AllowResizeInsideZoom property is True. 

The following screen show displays two inside zoom units with different size ( Week 26, and Week 28 ):

 

The following VB sample shows how can I change the width for a specified date time unit:
With G2antt1
	.BeginUpdate 
	With .Chart
		.LevelCount = 2
		.FirstVisibleDate = #1/1/2008#
		.AllowInsideZoom = True
		.AllowResizeInsideZoom = False
		.InsideZoomOnDblClick = False
		With .InsideZooms
			With .Add(#1/4/2008#)
				.Width = 32
				.AllowInsideFormat = False
			End With
		End With
	End With
	.EndUpdate 
End With
The following VB.NET sample shows how can I change the width for a specified date time unit:
With AxG2antt1
	.BeginUpdate 
	With .Chart
		.LevelCount = 2
		.FirstVisibleDate = #1/1/2008#
		.AllowInsideZoom = True
		.AllowResizeInsideZoom = False
		.InsideZoomOnDblClick = False
		With .InsideZooms
			With .Add(#1/4/2008#)
				.Width = 32
				.AllowInsideFormat = False
			End With
		End With
	End With
	.EndUpdate 
End With
The following C++ sample shows how can I change the width for a specified date time unit:
/*
	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->BeginUpdate();
EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart();
	var_Chart->PutLevelCount(2);
	var_Chart->PutFirstVisibleDate("1/1/2008");
	var_Chart->PutAllowInsideZoom(VARIANT_TRUE);
	var_Chart->PutAllowResizeInsideZoom(VARIANT_FALSE);
	var_Chart->PutInsideZoomOnDblClick(VARIANT_FALSE);
	EXG2ANTTLib::IInsideZoomsPtr var_InsideZooms = var_Chart->GetInsideZooms();
		EXG2ANTTLib::IInsideZoomPtr var_InsideZoom = var_InsideZooms->Add("1/4/2008");
			var_InsideZoom->PutWidth(32);
			var_InsideZoom->PutAllowInsideFormat(VARIANT_FALSE);
spG2antt1->EndUpdate();
The following C# sample shows how can I change the width for a specified date time unit:
axG2antt1.BeginUpdate();
EXG2ANTTLib.Chart var_Chart = axG2antt1.Chart;
	var_Chart.LevelCount = 2;
	var_Chart.FirstVisibleDate = "1/1/2008";
	var_Chart.AllowInsideZoom = true;
	var_Chart.AllowResizeInsideZoom = false;
	var_Chart.InsideZoomOnDblClick = false;
	EXG2ANTTLib.InsideZooms var_InsideZooms = var_Chart.InsideZooms;
		EXG2ANTTLib.InsideZoom var_InsideZoom = var_InsideZooms.Add("1/4/2008");
			var_InsideZoom.Width = 32;
			var_InsideZoom.AllowInsideFormat = false;
axG2antt1.EndUpdate();
The following VFP sample shows how can I change the width for a specified date time unit:
with thisform.G2antt1
	.BeginUpdate
	with .Chart
		.LevelCount = 2
		.FirstVisibleDate = {^2008-1-1}
		.AllowInsideZoom = .T.
		.AllowResizeInsideZoom = .F.
		.InsideZoomOnDblClick = .F.
		with .InsideZooms
			with .Add({^2008-1-4})
				.Width = 32
				.AllowInsideFormat = .F.
			endwith
		endwith
	endwith
	.EndUpdate
endwith


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.