Private Sub CREA_LVORARI()
Dim DA As Date, A As Date
Dim D As Date
DA = "07:00"
A = "21:30"
With Me.LVORARI
LockWindowUpdate Me.hwnd
.ColumnHeaders.Clear
.ColumnHeaders.Add , , "TAVOLO", 2000
.ColumnHeaders.Add , , "DATA", 1000, lvwColumnCenter
For D = DA To A + 0.000001 Step TimeSerial(0, 30, 0)
.ColumnHeaders.Add , , Format$(D, "HH:MM"), 600, lvwColumnCenter
Next D
For K = 0 To UBound(STRDBROWS_TAVOLI, 2)
TAVOLO = STRDBROWS_TAVOLI(2, K) & "-" & "TAVOLO-POSTI: " & STRDBROWS_TAVOLI(1, K)
Set ITMX = .ListItems.Add(, , TAVOLO)
Next K
LockWindowUpdate 0&
End With
End Sub
i call:
Private Sub Form_Initialize()
call CREA_LVORARI
End Sub
note:
STRDBROWS_TAVOLI is an array variant from getrow of recorset
Me.LVORARI is the listview
the array have only 23 element!
Ok, then there is something else going on in your code. If we just use the code you present here (and with an artificial STRDBROWS_TAVOLI array) then the LV populates pretty much instantaneously. Have you, for example, got any events for the ListView?
Er ... it's your code, you should be able to see if you have any events defined. I'm not going to randomly guess.
And let's also be clear - I am speculating; a control event might be the cause of the slowdown. But there may be other causes. Without seeing your code there's no way right now to determine what is actually causing the slowdown. It might, for example, be linked to the Sorted property (although I doubt it). Or anything, We can't know from the code you have posted here so far.
RE: very slow to create at run time listview
RE: very slow to create at run time listview
20 SECS approx
RE: very slow to create at run time listview
RE: very slow to create at run time listview
RE: very slow to create at run time listview
And let's also be clear - I am speculating; a control event might be the cause of the slowdown. But there may be other causes. Without seeing your code there's no way right now to determine what is actually causing the slowdown. It might, for example, be linked to the Sorted property (although I doubt it). Or anything, We can't know from the code you have posted here so far.
RE: very slow to create at run time listview
https://docs.microsoft.com/en-us/dotnet/api/system...
RE: very slow to create at run time listview
That's for the .Net listview control. This forum is for classic VB (VB5/6), and its somewhat less functional listview control