Why not a drag select. If I remember there are like box controls.
control.remove() i believe removes a control.
Now that you understand how to create controls dynamically and remove them.
Basically when you click down create a box control at the mouse postion x and y. Then use the mouse move to drag out the box. and then use a mouseup to then find the starting x,y and ending x,y.
Because you can make arrays of controls in vb6 (was removed for the better from vb.net) you can create all your units at once on the screen and loop through them quite easily.
Create a box off the main view area called Mr. "boxy" these will be your units that you want to select. I used a button you might want to do this onload.
(I believe you can use the unload to remove dynamicly created indexes of control arrays).
Private Sub Command1_Click()
For i = 1 To 10
boxy(i).Visible = True
If i = 1 Then
boxy(i).top = 10
boxy(i).left = 10
boxy(i).Top = boxy(i-1).Top + boxy(i-1).Height + 2
With an array of units you can actually loop through them to move them to see if they are in the selection range of your cursor.
Global these in a module.
Mouse Event Code where mousedown will set the start_selection_x/y and the mouseup will end it.
global start_selection_x = 0
global start_selection_y = 0
global end_selection_x = 0
global end_selection_y = 0
global selected() as Integer
The mouse move will be used to draw a selection box so the user can see graphically what hes selecting.
Sub Form_MouseDown (Button As Integer, Shift As Integer, X as Single, Y As Single)
start_selection_x = x
start_selection_y = y
'Create a Visual Selection Box Dynamically here at x,y
Sub Form_MouseMove (Button As Integer, Shift As Integer, X as Single, Y As Single)
'Resize the visual selection box.
Downside that you have to fix is you can only select from top left to bottom right (simple logic can fix that I'll let you do this if you choose).
Sub Form_MouseUp (Button As Integer, Shift As Integer, X as Single, Y As Single)
Dim j as Integer = 0
'Clears out selected array.
end_selection_x = x
end_selection_y = y
'For loop through boxes to see which top and left are in the area.
For i = 1 To 10
if boxy(i).top > start_selection_y and boxy(i).left > start_selection_x and boxy(i).top < y and boxy(i).left < x Then
selected(j) = i
j += 1;
With the selected in an array you can now use this on your key events(if you can understand it, it basically moves all the selected objects for the w key):
Thats all I'm gonna type today it should help some... also remember that I haven't used vb6 in a very long time and I typed it all in the browser.
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 87 Then 'Keycode for W=87
For i = 0 To UBound(selected())
boxy(selected(i)).Top = boxy(selected(i)).Top - 30
You may also when adding them change their color its probably something like "boxy.color".