Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where would I use 'LockWindowUpdate' in this code??

Status
Not open for further replies.

MrVB50au

Programmer
Mar 16, 2003
326
AU
Ok, Someone kindly suggested that I use the 'LockWindowUpdate' API to quicken control array refreshing and Loading of controls, it's a great idea but I'm afraid I have NO IDEA where I would put it.

Remember, I'm creating a 3D effect with text using label controls and could load in the range from 1 to 50 loads of the control array.

Private Sub Move3DRight(lbl As Object, HowFast As Integer)
'********************************************************
'THIS PROCEDURE MOVES AN ARRAY OF LABELS CONTROLS TO THE
'RIGHT. THE CANVUS IS A PICTUREBOX WHERE ALL LABEL
'CONTROLS ARE MOVED CREATED AND 3D EFFECTS IMPLIMENTED.
'********************************************************
'
'Check to see if user chose the 3D Effect on this
'label control. If they did, then array is greater
'than zero.

If lbl.Count > 0 Then
'
'The user chose the 3D effect, so count the
'number in the array that were used.

For i = 1 To lbl.Count - 1
'
'Move to the right (eg: 'HowFast' = 50 twips)

With lbl(i)
.Left = .Left + HowFast
End With
Next
i 'Go to the next label in the array.
End If 'Finish the array ( all is moved ).
End Sub
-----------------------------------------------------------
If anyone could help it would be very much appreciated.
Thanks again,
Andrew.

 
Code:
If lbl.Count > 0 Then
  '
  ' Lock window here    
  '
  For i = 1 To lbl.Count - 1
    With lbl(i)
      .Left = .Left + HowFast
    End With
  Next i
  '
  ' Unlock window here.
  '
End If


If you want to get the best response to a question, please check out FAQ222-2244 first
 
strongm -
Didn't realize the original thread had continued on. Excellent analogy, BTW. Like the old carpenter's adage: measure twice, cut once. Only in this case it's move twice, paint once.

MrVB50au -
Try coding it like strongm & I have suggested. Also, please don't start new threads on the same topic.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top