473,486 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

getting control properties

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
Nov 20 '05 #1
3 863
"everett" <an*******@discussions.microsoft.com> schrieb
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
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
Armin,

That worked great....
Thank you....
Ev
-----Original Message-----
"everett" <an*******@discussions.microsoft.com> schrieb
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
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

.

Nov 20 '05 #3
* "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>
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3323
by: deko | last post by:
I'm hoping someone can sanity check my understanding of the Object Model for Forms/Controls. I'm having trouble drilling down into Control properties. First, I have a record set with the...
11
2005
by: KarimL | last post by:
Thanks for your advices... but i need to get the Image height because i dynamically resize the height of my webcontrol based on the image height. More i just have the url (relative parth) to the...
2
2821
by: Alex | last post by:
Hi all, I'm writing a small web application which searches a database based on a date field, and populates a datagrid control with the results. The datagrid control has selection buttons added...
5
5924
by: Nathan Sokalski | last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an...
2
1359
by: NomoreSpam4Me | last post by:
Hi, right now i have a database that calcul attendance time. I have a qry with Date, EmployeeName, EmployeeID, PayCodeName, TimeInSecond. In the PayCodeName there is multiple thing, like,...
5
4684
by: hayworth | last post by:
How do I get the color depth of the screen/display adapter with vb.net 2003? Background: We're having transparency problems (long side story and known Windows "bug") that requires our systems to...
8
1555
by: MattB | last post by:
I have a asp.net 1.1/vb application that has a page with a bunch of dynamically added User Controls. When I add the controls, I set the UserControl.EnableViewState to true. For all my controls...
7
7439
by: GaryDean | last post by:
I am writing a method in a component that gets passed a 1.1 Datagrid. The datagrid's columns were created at run time meaning it has no columns collection. How can I access Header and Footer...
1
1654
by: Roffers | last post by:
Okay I have a parent page, we'll call it parent.aspx and it holds the following two user controls <uc1:Box1 id="Box1" runat="server"></uc1:Box1<----THIS CONTAINS A DROP DOWN LIST <br>...
0
1981
by: aboutjav.com | last post by:
Hi, I need some help. I am getting this error after I complete the asp.net register control and click on the continue button. It crashed when it tries to get it calls this Profile property ...
0
7099
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7319
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4864
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.