Advertisement
4_2005-2006 Miscellaneous #161673

Lock controls for fast updates

When you, for example, add listitems to a listbox or combo box Windows repaints the box after each addidtion. This takes up processing time, makes your app look bad (due to flickering) and if you add a lot of items it can take a long time(Especially if the Combo or Listbox Sorted properety is set to true) Windows provides an API called LockWindowUpdate that you can use to keep Windows from updating a control with a hWnd property. This code is a simple way to call that function.

AI

AI 摘要: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

源代码
original-source
Public Sub LockControl(objX As Object, cLock As Boolean)
 Dim i As Long
 If cLock Then
  ' This will lock the control
  LockWindowUpdate objX.hWnd
 Else
  ' This will unlock controls
  LockWindowUpdate 0
  objX.Refresh
 End If
End sub
'-- End --'
原始评论 (3)
从 Wayback Machine 恢复