VB Code:
Private Function GetObjectByName(ByVal Name As String) As Object Dim Obj As Object For Each Obj In Me.Controls If LCase(Obj.Name) Like LCase(Name) Then Set GetObjectByName = Obj Exit For End If Next Obj End Function Private Sub Form_Load() GetObjectByName("text1").Text = "hello there" End Sub
in your case you could do something like:
VB Code:
bitblt carscreen.hDC, 0, 0, 50, 50, GetObjectByName("paper" & colorn).hDC, 0, 0, SRCCOP




Reply With Quote