getting control properties

  • Thread starter Thread starter everett
  • Start date Start date
E

everett

hello,

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.

any help is appreciated.....

thnx
Ev
 
everett said:
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.

any help is appreciated.....

if typeof c is DavidLabel then
dim d as DavidLabel
d = directcast(c, DavidLabel)
d.<member>
end if
 
* "everett said:
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>
 
Back
Top