what contains the ContextMenuStrips ?

  • Thread starter Thread starter pamelafluente
  • Start date Start date
P

pamelafluente

hello

I need to iterate on the ContextMenuStrips that are on one of my form.

I tried by iterating within "controls" looking for the type
"ContextMenuStrip", but there seems to be no ContextMenuStrip even if I
do have some of them on my form.

What is the "container" where I have to look for ? I cannot figure out
this simple thing! :(


-P
 
They arent in the controls collection as they arent on the form, they are
assigned to the ContextMenu properties of controls, you could iterate through
the controls on the form and get them from that property, then add them to a
collection for future reference.
The VS designer adds them to a components collection but not sure if that is
there and populates at runtime.

HTH

Ciaran O'Donnell
 

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

Back
Top