Okay, so I have a tiny function that is meant to set the [blue]ScrollWidth[/blue] of a [blue]TListBox[/blue].
However, it does not seem to work when any string in it is long.
Both i and j are locally declared integers.
Any thoughts?
~
Give a man some fire, he will be warm for a day, Set a man on fire, he will be warm for the rest of his life.
However, it does not seem to work when any string in it is long.
Code:
j := 0; // Set scroll width for terms
for i := 0 to (ListBox1.Items.Count - 1) do
if ((ListBox1.Canvas.TextWidth(ListBox1.Items[i]) + 15) > j) then
j := (ListBox1.Canvas.TextWidth(ListBox1.Items[i]) + 15);
ListBox1.ScrollWidth := j;
Both i and j are locally declared integers.
Any thoughts?
~
Give a man some fire, he will be warm for a day, Set a man on fire, he will be warm for the rest of his life.