
Control arrays in Embedded VB
I'd really appreciate advice. I'm intending to port a working VB6
application to a handheld like a pocket PC. The application has one control
array of 11 labels for holding display data, and another of 36 laid out
like a keyboard.
I want to control the keyboard closely to eliminate invalid data being
entered such as letters when I expect numbers.
However, I'm new to this development environment which is embedded VB
(loaded from the MS web site) and am finding it a bit baffling. It does
not seem to support control arrays - it just has no mention of them and
they crash the environment or the PC if you force them into the form
(cut/pasted with word - serves me right!).
I can reduce interaction with these labels by maintaining their property
settings in arrays but am left with a minimum of writing caption and
borderstyle with one set, caption and backcolor with another, creating 11 +
36 nearly identical click routines, and creating code of the sort:
sub SetBoxCaption(index as integer, newvalue as string)
select index
case 1: box1.caption = newvalue$
case 2:
..
..
case 35: box35.caption = newvalue$
end select
end sub
ditto for borderstyle and backcolor. That is so very tedious and
inelegant.
Am I missing something really obvious? Is there some other control,
container or technique I could use? Am I trying to do this in a way
which is totally 'un-natural'? Am I using the wrong tools altogether?
Also, the environment help is a bit turgid; can anyone recommend good
literature on this?
Thanks in anticipation.
Phil Brady