I’m trying to implement a progress bar in column 1 of a 2 column listbox (column one being actually the second column… first = 0 second=1 of course) using the CellTextPaint event with the following code:
Select Case column Case 1 g.ForeColor = &c006600 g.FillRect(2, 2, g.Width-2, g.Height-4) g.ForeColor = &c00ff00 g.FillRect(2, 2, (g.Width-2)*(myProgress/100), g.Height-4) return True end Select
myProgress is a public property
Additionally, the listbox Open event adds a row to the listbox with me.AddRow and then calls a method, AllEditable, that sets all cells to editable:
for i as integer = 0 to Listbox1.ColumnCount-1 for j as integer = 0 to Listbox1.LastIndex Listbox1.CellType(j,i)=Listbox.TypeEditableTextField next next
I have a timer (mode2 period=10) in the same window with the following in the Action event:
myProgress = myProgress + 1 if myProgress > 100 then myProgress = 0 ProgressBar1.Value = myProgress
the ProgressBar1 control is a separate control on the window that I’m using to troubleshoot the fact that updates are actually occurring.
THE PROBLEM: The cellTextPaint event does not update on Windows (Windows 7) unless you do something like resize the window, while the standalone progress bar does update appropriately. On the Mac, both progress bars… the standalone one as well as the CellTextPaint event one… do update correctly. What have I forgotten in order to make this work on Windows?