Accessing controls that are attached to a tray control

R

Robert Kemp

I am creating a non-visible/tray control that monitors other custom controls
for changes (among other things). One of the monitored controls is a new
textbox that adds functionality to the standard textbox, and includes a
variable that points to the monitoring tray control... it works just like
the imagelist that is attached to any control that supports imagelists, such
as a treeview or listview. Everything is working the way I would like at
this point -- Custom event handling, reading/writing properties, etc.

Now I would like to iterate through the list of controls attached to the
tray control. Using the imagelist as an example, I want to loop through a
collection of all the controls that are attached to (are using) a certain
imagelist.

I haven't found a way to do this using the tray control object. One thing
that I considered was iterating through the form's controls and checking for
the tray control property, but this seems like a slow and undesirable
solution.

Is there a better way to efficiently access the controls attached to a tray
control in the way that I am describing?

Thank you,
Robert
 
R

Robert Kemp

I looked at the extender provider pages, but don't know how to work that
into my program...

A single imagelist can be used by one or more controls. For example, I
have an imagelist named ilsMain in the tray of my programs main form. I
also have two treeviews tvwMain and tvwSub each using the ilsMain
imagelist. Is there any way that I can access ilsMain to determine that
tvwMain and tvwSub are using that imagelist?

=============

More in depth information about what I am really doing...
I am using the imagelist as an example here, but what I have done is
created my own custom tray control (just like the imagelist) that is
used by a bunch of custom textboxes. I want to get a list of textbox
controls via a loop through the tray control.

I have a "monitor" control named monMain. I also have 20 textboxes that
have a property that points to the monMain control. I would like to
loop through something in the monMain control that will allow me to
access the 20 textboxes controls. I am creating these custom controls
to minimize coding of repetitive tasks for the textboxes, while using a
handful of global properties available in the monMain control.

Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top