property G2antt.ScrollPartCaptionAlignment(ScrollBar as ScrollBarEnum, Part as ScrollPartEnum) as AlignmentEnum
Specifies the alignment of the caption in the part of the scroll bar.

 TypeDescription 
   ScrollBar as ScrollBarEnum A ScrollBar expression that indicates the scrollbar where the caption is displayed.  
   Part as ScrollPartEnum A ScrollPartEnum expression that specifies the parts of the scroll where the text is displayed  
   AlignmentEnum An AlignmentEnum expression that specifies the alignment of the caption in the part of the scrollbar.  
The ScrollPartCaptionAlignment property specifies the alignment of the caption in the part of the scroll bar. By default, the caption is centered. Use the ScrolPartCaption property to specify the caption being displayed on specified part of the scroll bar. Use the ScrollPartVisible property to add or remove buttons/parts in the control's scrollbar.

The following VB sample displays "left" aligned to the left on the lower part of the control's horizontal scroll bar, and "right" aligned to the right on the upper part of the control's horizontal scroll bar:

With G2antt1
	.ScrollPartCaption(exHScroll,exLowerBackPart) = "left"
	.ScrollPartCaptionAlignment(exHScroll,exLowerBackPart) = LeftAlignment
	.ScrollPartCaption(exHScroll,exUpperBackPart) = "right"
	.ScrollPartCaptionAlignment(exHScroll,exUpperBackPart) = RightAlignment
	.ColumnAutoResize = False
	.Columns.Add 1
	.Columns.Add 2
	.Columns.Add 3
	.Columns.Add 4
End With

The following VB.NET sample displays "left" aligned to the left on the lower part of the control's horizontal scroll bar, and "right" aligned to the right on the upper part of the control's horizontal scroll bar:

With AxG2antt1
	.set_ScrollPartCaption(EXG2ANTTLib.ScrollBarEnum.exHScroll,EXG2ANTTLib.ScrollPartEnum.exLowerBackPart,"left")
	.set_ScrollPartCaptionAlignment(EXG2ANTTLib.ScrollBarEnum.exHScroll,EXG2ANTTLib.ScrollPartEnum.exLowerBackPart,EXG2ANTTLib.AlignmentEnum.LeftAlignment)
	.set_ScrollPartCaption(EXG2ANTTLib.ScrollBarEnum.exHScroll,EXG2ANTTLib.ScrollPartEnum.exUpperBackPart,"right")
	.set_ScrollPartCaptionAlignment(EXG2ANTTLib.ScrollBarEnum.exHScroll,EXG2ANTTLib.ScrollPartEnum.exUpperBackPart,EXG2ANTTLib.AlignmentEnum.RightAlignment)
	.ColumnAutoResize = False
	.Columns.Add 1
	.Columns.Add 2
	.Columns.Add 3
	.Columns.Add 4
End With

The following C# sample displays "left" aligned to the left on the lower part of the control's horizontal scroll bar, and "right" aligned to the right on the upper part of the control's horizontal scroll bar:

axG2antt1.set_ScrollPartCaption(EXG2ANTTLib.ScrollBarEnum.exHScroll,EXG2ANTTLib.ScrollPartEnum.exLowerBackPart,"left");
axG2antt1.set_ScrollPartCaptionAlignment(EXG2ANTTLib.ScrollBarEnum.exHScroll,EXG2ANTTLib.ScrollPartEnum.exLowerBackPart,EXG2ANTTLib.AlignmentEnum.LeftAlignment);
axG2antt1.set_ScrollPartCaption(EXG2ANTTLib.ScrollBarEnum.exHScroll,EXG2ANTTLib.ScrollPartEnum.exUpperBackPart,"right");
axG2antt1.set_ScrollPartCaptionAlignment(EXG2ANTTLib.ScrollBarEnum.exHScroll,EXG2ANTTLib.ScrollPartEnum.exUpperBackPart,EXG2ANTTLib.AlignmentEnum.RightAlignment);
axG2antt1.ColumnAutoResize = false;
axG2antt1.Columns.Add(1.ToString());
axG2antt1.Columns.Add(2.ToString());
axG2antt1.Columns.Add(3.ToString());
axG2antt1.Columns.Add(4.ToString());

The following C++ sample displays "left" aligned to the left on the lower part of the control's horizontal scroll bar, and "right" aligned to the right on the upper part of the control's horizontal scroll bar:

/*
	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->PutScrollPartCaption(EXG2ANTTLib::exHScroll,EXG2ANTTLib::exLowerBackPart,L"left");
spG2antt1->PutScrollPartCaptionAlignment(EXG2ANTTLib::exHScroll,EXG2ANTTLib::exLowerBackPart,EXG2ANTTLib::LeftAlignment);
spG2antt1->PutScrollPartCaption(EXG2ANTTLib::exHScroll,EXG2ANTTLib::exUpperBackPart,L"right");
spG2antt1->PutScrollPartCaptionAlignment(EXG2ANTTLib::exHScroll,EXG2ANTTLib::exUpperBackPart,EXG2ANTTLib::RightAlignment);
spG2antt1->PutColumnAutoResize(VARIANT_FALSE);
spG2antt1->GetColumns()->Add(L"1");
spG2antt1->GetColumns()->Add(L"2");
spG2antt1->GetColumns()->Add(L"3");
spG2antt1->GetColumns()->Add(L"4");

The following VFP sample displays "left" aligned to the left on the lower part of the control's horizontal scroll bar, and "right" aligned to the right on the upper part of the control's horizontal scroll bar:

with thisform.G2antt1
	.ScrollPartCaption(1,512) = "left"
	.ScrollPartCaptionAlignment(1,512) = 0
	.ScrollPartCaption(1,128) = "right"
	.ScrollPartCaptionAlignment(1,128) = 2
	.ColumnAutoResize = .F.
	.Columns.Add(1)
	.Columns.Add(2)
	.Columns.Add(3)
	.Columns.Add(4)
endwith

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