* "everett" <an*******@discussions.microsoft.com> scripsit:
I created a custom label called david label, then added
them to a panel called mainMenuPan.
I now need to get the values of the properties of the
labels from another sub.
I have found how to loop through the controls for the
panel, but cannot figure out how to access the values of
the specific properties, such as the image property, and
I need to change it.
If you use 'Option Strict Off' just type the member and it will work.
If you use 'Option Strict On' (preferred) you need a cast:
\\\
DirectCast(c, MyControlType).TheMember = TheValue
///
If you access more than one member, use a typed varaible to store the
reference:
\\\
Dim cc As MyControlType = DirectCast(c, MyControlType)
With cc
.TheMember = TheValue
.TheOtherMember = TheOtherValue
End With
///
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
<http://www.plig.net/nnq/nquote.html>