Bob
2009-11-15 18:46:00 UTC
I am trying to make a two column listbox by setting the tabstop to slightly
larger than the longest string in the first column. By using the graphics
context of the listbox and MeasureString(), I know that the longest string
in the first column is 93 pixels (for instance). However, I can't figure
out the correct value for the ListBox.IntegerCollection.Add() parameter. If
I use the pixel value, the spacing is always about 40% too large (no matter
what strings are in the first column).
Note: I am not using the MultiColumn function of the ListBox. The ListBox
is an a custom control and I am using the ListBox Format() method to
intercept the ListBox.Items.Add() calls to insert a tab ("\t") between the
two strings in the columns.
What is the relationship between pixels and the TabStop values?
Thanks
larger than the longest string in the first column. By using the graphics
context of the listbox and MeasureString(), I know that the longest string
in the first column is 93 pixels (for instance). However, I can't figure
out the correct value for the ListBox.IntegerCollection.Add() parameter. If
I use the pixel value, the spacing is always about 40% too large (no matter
what strings are in the first column).
Note: I am not using the MultiColumn function of the ListBox. The ListBox
is an a custom control and I am using the ListBox Format() method to
intercept the ListBox.Items.Add() calls to insert a tab ("\t") between the
two strings in the columns.
What is the relationship between pixels and the TabStop values?
Thanks