By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,065 Members | 1,598 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,065 IT Pros & Developers. It's quick & easy.

me.controls

P: n/a
me.fraDate.Top = Me.Controls("fra" & Me.cboDate.Text).Top

The top line is from vb6 how can I do the same thing in
vb.net?

fraDate is a panal
me.cbodate is a combo box with a value of 1 - 6 in it.
I also have 6 panals named fra1, fra2, fra3, etc.

Thanks for the help!
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
* "craig" <an*******@discussions.microsoft.com> scripsit:
me.fraDate.Top = Me.Controls("fra" & Me.cboDate.Text).Top

The top line is from vb6 how can I do the same thing in
vb.net?


Add all controls to a hashtable ('Hashtable'), the name as key and the
value is the reference to the control.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
come on there must be a way to refer to it directly as in
vb6.
-----Original Message-----
* "craig" <an*******@discussions.microsoft.com> scripsit:
me.fraDate.Top = Me.Controls("fra" & Me.cboDate.Text).Top
The top line is from vb6 how can I do the same thing in vb.net?
Add all controls to a hashtable ('Hashtable'), the name

as key and thevalue is the reference to the control.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #3

P: n/a
* "craig" <an*******@discussions.microsoft.com> scripsit:
come on there must be a way to refer to it directly as in
vb6.


No, there is no direct way to refer to the controly by their name.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

P: n/a
ok, so I dim a 2 dimential array? The first column being
the number (1-6) and the second column being the name of
the corresponding panal?

What do I dim the arrary as a string? How do I use the
array in a statment latter on in the program?

Thanks for the help!
-----Original Message-----
* "craig" <an*******@discussions.microsoft.com> scripsit:
come on there must be a way to refer to it directly as in vb6.
No, there is no direct way to refer to the controly by

their name.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #5

P: n/a
* <an*******@discussions.microsoft.com> scripsit:
ok, so I dim a 2 dimential array? The first column being
the number (1-6) and the second column being the name of
the corresponding panal?

What do I dim the arrary as a string? How do I use the
array in a statment latter on in the program?


<http://groups.google.com/groups?selm=bq5rdn%241ramms%247%40ID-208219.news.uni-berlin.de>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6

P: n/a
Ian
Hi,

Kind of an aside, but a keyed Controls collection will be in the next
version of Windows Forms.

Ian

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bu************@ID-208219.news.uni-berlin.de...
* "craig" <an*******@discussions.microsoft.com> scripsit:
come on there must be a way to refer to it directly as in
vb6.


No, there is no direct way to refer to the controly by their name.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.