.NET Menu not a control?

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

Hi there,

I'm running into slight confusion over a .NET menu "control", how comes
it doesn't get listed in the forms controls array? I'm trying to enumerate
through *every* control on any form, and unfortunately unlesss I treat the
menu as a separate entity and then enumerate it after It wont work.

Does anyone know how I can enumerate *every* control on any form in
VB.NET? Cheers in advance.

Nick
 
Its a component not a control and you can use reflexion
to browse controls/components.

Regards
Jorge
 
Nick,

Nick said:
I'm running into slight confusion over a .NET menu "control", how comes
it doesn't get listed in the forms controls array? I'm trying to
enumerate through *every* control on any form, and unfortunately unlesss I
treat the menu as a separate entity and then enumerate it after It wont
work.

Does anyone know how I can enumerate *every* control on any form in
VB.NET?

'MainMenu' is, like timers, for example, a component. See (complete
thread):

<URL:http://groups.google.de/[email protected]>

Keywords: enumerate, components, controls, form.
 
I'm running into slight confusion over a .NET menu "control", how comes
it doesn't get listed in the forms controls array? I'm trying to enumerate
through *every* control on any form, and unfortunately unlesss I treat the
menu as a separate entity and then enumerate it after It wont work.

Does anyone know how I can enumerate *every* control on any form in
VB.NET? Cheers in advance.

a.. Controls. The System.Windows.Forms namespace provides a variety of
control classes that allow you to create rich user interfaces. Some controls
are designed for data entry within the application, such as TextBox and
ComboBox controls. Other controls display application data, such as Label
and ListView. The namespace also provides controls for invoking commands
within the application, such as Button and ToolBar. In addition, the
PropertyGrid control can be used to create your own Windows Forms designer
that displays the designer-visible properties of the controls.
a..

Components. In addition to controls, the System.Windows.Forms namespace
provides other classes that do not derive from the Control class but still
provide visual features to a Windows-based application. Some classes, such
as ToolTip and ErrorProvider, extend the capabilities or provide information
to the user. Other classes, such as Menu, MenuItem, and ContextMenu, provide
the ability display menus to the user to invoke commands within an
application. The Help and HelpProvider classes enable you to display help
information to the user of your ap


Hope this useful,
Roger
 
Hi Jorge,
Its a component not a control and you can use reflexion
to browse controls/components.

Aaah, cool, this is helpful, I've ended up using another solution
temporarily but this is very helpful thanks!

Nick.
 

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