View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Auto move scroll bars of listbox

Jon, jon

similar as application.wait the Sleep function suspends the execution
of the current thread for a specified interval. This is a so called
windows API call.

the sleep is just for the demo to keep the loop slow enough to see it
move...



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


JON JON wrote :

Keep ITcool,

Thank you very much it was a great help.

Can you please extend more help by explaining what does the "Sleep
100" do? I am just really curious about it.

TIA,

Jon-jon



"keepITcool" wrote in message
ft.com...
topindex demo...

Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)

Private Sub UserForm_activate()
Dim i%
With ListBox1
For i = 1 To 100
.AddItem "item" & Format(i, " 000")
If .ListCount 5 Then
.TopIndex = .ListCount - 5
End If
Me.Repaint
Sleep 100
Next
End With
Unload Me
End Sub

--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam



Tom Ogilvy wrote :

Look at the topIndex property of the Listbox.