How to Pass a Control Group as a Procedure Parameter
Posted on 2005-02-26
I have a group of picture controls and command buttons on a form. I need to pass the control groups to a Sub or Function.
This is my code:
ScanGroup me.picCards(), me.cmdPickOne
Sub ScanGroup(ppicCards() as PictureBox, pcmdPickOne() as Control)
Dim intCtr1 as integer
For intCtr1 to ppicCards.Count - 1
If ppicCards(intctr) = pintCritical Then
For intCtr1 to pcmdPickOne.Count - 1
If pcmdPickOne(intctr) = pintCritical Then
When I try to compile, I get a type mismatch error. This comes from an incorrect parameters statement.
I can pass arrays with no problem.
What is different about control groups?
What am I doing wrong ?