AdjustWidthOnlyVisible: Boolean;
AdjustWidthOnlyVisible: boolean;
The AdjustWidthOnlyVisible property determines the mode of column width autofit.
Available values:
True. Autofit takes into account only width of visible component elements. Width of elements available with scrolling is ignored.
False. Default value. Autofit takes into account width of all elements.
To autofit the width, double-click the column between borders or use the IDimensionViewer.AdjustWidth method.
Executing the example requires a form with the button named Button1 on it, the DimensionTree component named DimensionTree1 and the UiDimension component that is a data source for DimensionTree1. A dictionary is linked to UiDimension.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
DimensionTree1.ShowColumnHeaders := True;
DimensionTree1.AdjustWidthOnlyVisible := True;
DimensionTree1.HighlightTrack := False;
DimensionTree1.ShowHeaderButton := True;
DimensionTree1.AdjustWidth(0);
DimensionTree1.UseSystemImages := True;
End Sub Button1OnClick;
Clicking the button displays column headers and a button that opens column headers menu, width of the first column is autofitted considering only visible elements, elements highlighting on hover is disabled; standard icons are used in the DimensionTree1 component.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Begin
dimensionTreeNet1.CtrlBox.ShowColumnHeaders := True;
dimensionTreeNet1.CtrlBox.AdjustWidthOnlyVisible := True;
dimensionTreeNet1.CtrlBox.HighlightTrack := False;
dimensionTreeNet1.CtrlBox.ShowHeaderButton := True;
dimensionTreeNet1.CtrlBox.AdjustWidth(0);
dimensionTreeNet1.CtrlBox.UseSystemImages := True;
End Sub;
See also: