property G2antt.RightToLeft as Boolean
Indicates whether the component should draw right-to-left for RTL languages.

 TypeDescription 
   Boolean A boolean expression that specifies whether the control is drawn from right to left or from left to right.  
By default, the RightToLeft property is False. The RightToLeft gets or sets a value indicating whether control's elements are aligned to right or left. The RightTolLeft property affects all columns, and future columns being added. 

Changing the RightToLeft property on True does the following:

The following screen shot shows how the control looks if the RightToLeft property is True:

(By default) Changing the RightToLeft property on False does the following:

The following screen shot shows how the control looks if the RightToLeft property is False:

The following VB sample flips the order of the control's elements from right to left
With G2antt1
	.BeginUpdate 
	.ScrollBars = exDisableBoth
	.LinesAtRoot = exLinesAtRoot
	With .Columns.Add("P1")
		.Def(exCellHasCheckBox) = True
		.PartialCheck = True
	End With
	With .Items
		h = .AddItem("Root")
		.InsertItem h,0,"Child 1"
		.InsertItem h,0,"Child 2"
		.ExpandItem(h) = True
	End With
	.RightToLeft = True
	.EndUpdate 
End With
The following VB.NET sample flips the order of the control's elements from right to left
Dim h
With AxG2antt1
	.BeginUpdate 
	.ScrollBars = EXG2ANTTLib.ScrollBarsEnum.exDisableBoth
	.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot
	With .Columns.Add("P1")
		.Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox) = True
		.PartialCheck = True
	End With
	With .Items
		h = .AddItem("Root")
		.InsertItem h,0,"Child 1"
		.InsertItem h,0,"Child 2"
		.ExpandItem(h) = True
	End With
	.RightToLeft = True
	.EndUpdate 
End With
The following C++ sample flips the order of the control's elements from right to left
/*
	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();
spG2antt1->PutScrollBars(EXG2ANTTLib::exDisableBoth);
spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot);
EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"P1")));
	var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE);
	var_Column->PutPartialCheck(VARIANT_TRUE);
EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems();
	long h = var_Items->AddItem("Root");
	var_Items->InsertItem(h,long(0),"Child 1");
	var_Items->InsertItem(h,long(0),"Child 2");
	var_Items->PutExpandItem(h,VARIANT_TRUE);
spG2antt1->PutRightToLeft(VARIANT_TRUE);
spG2antt1->EndUpdate();
The following C# sample flips the order of the control's elements from right to left
axG2antt1.BeginUpdate();
axG2antt1.ScrollBars = EXG2ANTTLib.ScrollBarsEnum.exDisableBoth;
axG2antt1.LinesAtRoot = EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot;
EXG2ANTTLib.Column var_Column = (axG2antt1.Columns.Add("P1") as EXG2ANTTLib.Column);
	var_Column.set_Def(EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox,true);
	var_Column.PartialCheck = true;
EXG2ANTTLib.Items var_Items = axG2antt1.Items;
	int h = var_Items.AddItem("Root");
	var_Items.InsertItem(h,0,"Child 1");
	var_Items.InsertItem(h,0,"Child 2");
	var_Items.set_ExpandItem(h,true);
axG2antt1.RightToLeft = true;
axG2antt1.EndUpdate();
The following VFP sample flips the order of the control's elements from right to left
with thisform.G2antt1
	.BeginUpdate
	.ScrollBars = 15
	.LinesAtRoot = -1
	with .Columns.Add("P1")
		.Def(0) = .T.
		.PartialCheck = .T.
	endwith
	with .Items
		h = .AddItem("Root")
		.InsertItem(h,0,"Child 1")
		.InsertItem(h,0,"Child 2")
		.DefaultItem = h
		.ExpandItem(0) = .T.
	endwith
	.RightToLeft = .T.
	.EndUpdate
endwith
The following Delphi sample flips the order of the control's elements from right to left
with AxG2antt1 do
begin
	BeginUpdate();
	ScrollBars := EXG2ANTTLib.ScrollBarsEnum.exDisableBoth;
	LinesAtRoot := EXG2ANTTLib.LinesAtRootEnum.exLinesAtRoot;
	with (Columns.Add('P1') as EXG2ANTTLib.Column) do
	begin
		Def[EXG2ANTTLib.DefColumnEnum.exCellHasCheckBox] := TObject(True);
		PartialCheck := True;
	end;
	with Items do
	begin
		h := AddItem('Root');
		InsertItem(h,TObject(0),'Child 1');
		InsertItem(h,TObject(0),'Child 2');
		ExpandItem[h] := True;
	end;
	RightToLeft := True;
	EndUpdate();
end
 


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