-1

I use c# and c++ builder, and have big application with many menus, buttons, check boxses, and also with many forms. When trying to use one of functionality of those objects I use standard user method by clicking on button, clicking on menus and choose some submenu options, etc...

But now I want to use faster method to use functionality of objects, want to create search for objects. That means if I type name of some button and press enter, that those event become same as i click on same button. I don't want to clicking on buttons, and menus anymore cause it take me too much time to find it.

So I create new form which appear on shortcut and have inside listbox that will be using for search all objects, but I don't know what code to put inside that listbox show me all object names?

How to connect listbox with all objects which is inside project?

Alen
  • 1
  • 1

1 Answers1

2

In C#, every Control has Controls property that returns a collection of child controls. You can iterate through all the "children" of a form and add their names to your listbox. In the opposite direction, when you've got a control name, you can find it using Controls.Find() method.

For CBuilder case, refer to the following thread: BCB : how to iterate over controls on a form?

Community
  • 1
  • 1
Igor R.
  • 14,716
  • 2
  • 49
  • 83