From: C on
VB Express 2008 converts VB6 code with control arrays fine and it
seems to work, but I cannot figure out what exactly it is doing. There
is some VB6.Compatibility functionality. I have plenty of arrays of
text boxes and labels on several forms.

Another problem is that I cannot address Label31 on each Form by a
subroutine in a module by FormN.Label31. What is good way around this?

Thanks.
From: Martin H. on
Hello C,

> Another problem is that I cannot address Label31 on each Form by a
> subroutine in a module by FormN.Label31. What is good way around this?

you might want to check the modifier for that label.
If it is set to Private, you can't access it from outside.
the form.

Best regards,

Martin H.
From: J.B. Moreno on
<wrong.address.1(a)gmail.com> wrote:

> VB Express 2008 converts VB6 code with control arrays fine and it
> seems to work, but I cannot figure out what exactly it is doing. There
> is some VB6.Compatibility functionality. I have plenty of arrays of
> text boxes and labels on several forms.

It's doing the same thing that VB6 was doing, it's just more upfront
about it it -- it's creating a series of objects and adding them to a
array.

Unlike with VB6, these objects are directly addressable, so if you're
using constants for the array index you should just skip the array and
go directly to the back end object -- it'll have a name (that you can
change to be more re-memorable) and doing that makes your code more
understandable.

You might also look at iterating over the controls in containers
(panels, tabs and so forth), this might be related to what you're doing
with control arrays.

--
J.B. Moreno
From: C on
On 27 syys, 03:59, "J.B. Moreno" <pl...(a)newsreaders.com> wrote:
> <wrong.addres...(a)gmail.com> wrote:
> > VB Express 2008 converts VB6 code with control arrays fine and it
> > seems to work, but I cannot figure out what exactly it is doing. There
> > is some VB6.Compatibility functionality. I have plenty of arrays of
> > text boxes and labels on several forms.
>
> It's doing the same thing that VB6 was doing, it's just more upfront
> about it it -- it's creating a series of objects and adding them to a
> array.

Where do I find that code?

>
> Unlike with VB6, these objects are directly addressable, so if you're
> using constants for the array index you should just skip the array and
> go directly to the back end object -- it'll have a name (that you can
> change to be more re-memorable) and doing that makes your code more
> understandable.

Probably not because I have lots of arrays for mathematical or
engineering calculations and sometimes some of those arrays have to be
displayed, or the user.has to be allowed to feed in the values of some
of those arrays.

There are also a couple of matrices which need to be shown, but
instead of using the grid, I have used a textbox array for years, with
textbox locations rearranged every time.

>
> You might also look at iterating over the controls in containers
> (panels, tabs and so forth), this might be related to what you're doing
> with control arrays.

What is this for?

>
> --
> J.B. Moreno

Thanks.
From: C on
On 27 syys, 01:53, "Martin H." <hk...(a)gmx.net> wrote:
> Hello C,
>
> > Another problem is that I cannot address Label31 on each Form by a
> > subroutine in a module by FormN.Label31. What is good way around this?
>
> you might want to check the modifier for that label.
> If it is set to Private, you can't access it from outside.
> the form.
>
> Best regards,
>
> Martin H.

Its modifier is Public. Automatic conversion has done this.

Here is that subroutine:

Sub formsize(ByRef FormN As System.Windows.Forms.Form)

'UPGRADE_ISSUE: Form property FormN.ScaleWidth was not upgraded.
Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?
keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'
' FormN.ScaleWidth = 11940
FormN.Height = VB6.TwipsToPixelsY(8500)
FormN.Width = VB6.TwipsToPixelsX(12060)
FormN.BackColor = System.Drawing.ColorTranslator.FromOle(RGB(rrr,
ggg, bbb))
'UPGRADE_ISSUE: Form property FormN.DrawWidth was not upgraded.
Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?
keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'
' FormN.DrawWidth = 1
'UPGRADE_ISSUE: Control Label30 could not be resolved because it was
within the generic namespace Form. Click for more: 'ms-help://
MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="084D22AD-ECB1-400F-
B4C7-418ECEC5E36E"'
' FormN.Label30.Width = 8000
'UPGRADE_ISSUE: Control Label31 could not be resolved because it was
within the generic namespace Form. Click for more: 'ms-help://
MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="084D22AD-ECB1-400F-
B4C7-418ECEC5E36E"'
' FormN.Label31.Width = 8000
'UPGRADE_ISSUE: Control Label30 could not be resolved because it was
within the generic namespace Form. Click for more: 'ms-help://
MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="084D22AD-ECB1-400F-
B4C7-418ECEC5E36E"'
' FormN.Label30 = TitleS
'UPGRADE_ISSUE: Control Label31 could not be resolved because it was
within the generic namespace Form. Click for more: 'ms-help://
MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="084D22AD-ECB1-400F-
B4C7-418ECEC5E36E"'
' FormN.Label31 = SubtitleS
'UPGRADE_ISSUE: Control Label30 could not be resolved because it was
within the generic namespace Form. Click for more: 'ms-help://
MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="084D22AD-ECB1-400F-
B4C7-418ECEC5E36E"'
' FormN.Label30.ForeColor = RGB(r3, g3, b3)
'UPGRADE_ISSUE: Control Label31 could not be resolved because it was
within the generic namespace Form. Click for more: 'ms-help://
MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="084D22AD-ECB1-400F-
B4C7-418ECEC5E36E"'
' FormN.Label31.ForeColor = RGB(255, 255, 255)
If rrr = 255 And ggg = 255 And bbb = 255 Then
'UPGRADE_ISSUE: Control Label31 could not be resolved because it
was within the generic namespace Form. Click for more: 'ms-help://
MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="084D22AD-ECB1-400F-
B4C7-418ECEC5E36E"'
' FormN.Label31.ForeColor = RGB(0, 0, 0)
End If

End Sub