Home All Groups Group Topic Archive Search About
Author
20 Jun 2006 1:28 AM
James Wong
Hi,

I want to write a dynamic program to find ContextMenuStrip in the form,
but I cannot find this control see the code below.
How can I solve it?

------------------------------------------------
For i = 0 To Me.Controls.Count - 1
    MessageBox.Show(CStr(Me.Controls(i).Name))
Next
------------------------------------------------

Thanks!

Author
20 Jun 2006 4:10 AM
Ahmed
the contextmenustrip is in the components collection and not the
controls.

James Wong wrote:
Show quoteHide quote
> Hi,
>
> I want to write a dynamic program to find ContextMenuStrip in the form,
> but I cannot find this control see the code below.
> How can I solve it?
>
> ------------------------------------------------
> For i = 0 To Me.Controls.Count - 1
>     MessageBox.Show(CStr(Me.Controls(i).Name))
> Next
> ------------------------------------------------
>
> Thanks!
Author
20 Jun 2006 6:34 AM
Jeffrey Tan[MSFT]
Hi James,

I have added a reply to you in
microsoft.public.dotnet.framework.windowsforms.controls newsgroup, please
check it there. Thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.