R
Reg Verrin
I have a program that displays constantly changing prices which it
sources from the web once per second. The prices are displayed on a
Listbox (not the best choice but there are good reasons for this).
The Listbox flickers when updating and I can't find a solution on the
net.
Here is the code:
'update Listbox
listPrices.SuspendLayout()
For n = 1 To 20
LineStr = Space(16)
Mid(LineStr, 1, 10) = PriceData(n).ItemID
Mid(LineStr, 13, 4) = PriceData(n).ItemPrice
listPrices.Items(n - 1) = LineStr 'the fault is probably
here
Next n
listPrices.ResumeLayout()
I'm using VB 2005 Express.
Someone with a similar problem was advised to use SuspendLayout and
ResumeLayout and, as you can see, I tried that but it didn't help.
Any ideas?
sources from the web once per second. The prices are displayed on a
Listbox (not the best choice but there are good reasons for this).
The Listbox flickers when updating and I can't find a solution on the
net.
Here is the code:
'update Listbox
listPrices.SuspendLayout()
For n = 1 To 20
LineStr = Space(16)
Mid(LineStr, 1, 10) = PriceData(n).ItemID
Mid(LineStr, 13, 4) = PriceData(n).ItemPrice
listPrices.Items(n - 1) = LineStr 'the fault is probably
here
Next n
listPrices.ResumeLayout()
I'm using VB 2005 Express.
Someone with a similar problem was advised to use SuspendLayout and
ResumeLayout and, as you can see, I tried that but it didn't help.
Any ideas?