d As Long

Private Sub cmdClear_Click()
   m_iRowsToAdd = Rnd * 512 + 16
   lblTarget.Caption = m_iRowsToAdd
   grdVirtual.Clear
End Sub

Private Sub Form_Load()
   m_iRowsToAdd = Rnd * 512 + 16
   lblTarget.Caption = m_iRowsToAdd
   With grdVirtual
      .AddColumn , "Test1"
      .AddColumn , "Test2"
      .AddRowsOnDemand = True
   End With
End Sub

Private Sub grdVirtual_RequestRow(ByVal lRow As Long, lItemData As Long,
 bVisible As Boolean, lHeight As Long, bNoMoreRows As Boolean)
   If (lRow &gt; m_iR