ListBox.CustomTabOffsets Property
.NET Framework 4
Gets the width of the tabs between the items in the ListBox.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
What the values mean.
The integers in the array are measured from the edge of the ListBox and are in units of one quarter of the average character width of the font in the ListBox. So, to get an offset at 5 character widths from the edge followed by another one 10 characters after that, the code should look something like this.
listbox.CustomTabOffsets.Add(5 * 4);
listbox.CustomTabOffsets.Add((5 + 10) * 4);
The array is kept automatically sorted from smallest to largest, and duplicates are automatically removed. Thus the following code...
listbox.CustomTabOffsets.Add(100);
listbox.CustomTabOffsets.Add(50);
listbox.CustomTabOffsets.Add(50);
... will result in the array containing just two entries, 50 followed by 100.
listbox.CustomTabOffsets.Add(5 * 4);
listbox.CustomTabOffsets.Add((5 + 10) * 4);
The array is kept automatically sorted from smallest to largest, and duplicates are automatically removed. Thus the following code...
listbox.CustomTabOffsets.Add(100);
listbox.CustomTabOffsets.Add(50);
listbox.CustomTabOffsets.Add(50);
... will result in the array containing just two entries, 50 followed by 100.
- 1/24/2012
- Ante Meridian