This is a stupid, low level question but nevertheless I want to know if it is possible.
Right now I'm creating a form with around 60 boxes, where you can click on 1 box, drag to another and release, and the second box's color will change to that of the first box. I already have the drag and drop code in place, but I was wondering if it was possible to use an array as the name of the control so I wouldn't have to make individual code for each box.
My drag and drop code is like this:
Private Sub BoxAdd_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
UpdateMouse "BoxAdd", Button
End Sub
Sub UpdateMouse(Name As String, Button As Integer)
If LastState = 0 And Button = 1 Then
Dragged = Name
End If
If LastState = 1 And Button = 0 Then
Dropped = Name
If Dragged = "BoxAdd" Then
Which works fine, but then I have 60 if statements that look like this:
If Dropped = "M1" Then
M1.BackColor = BoxAdd.BackColor
Is there a way I could use 1 single string to assign the color (instead of M1.BackColor assign M1 to some StringName and say StringName.BackColor) or even use an array for it?
Sorry for the confusing question, ask if clarification will help