4

Our previous developer used a plugin (Infragistics) in order to create the UI components (buttons, tabs, docks, labels, etc.) but it requires all of it's DLLs to be included.

I'm looking to convert this to a basic WinForm with "stock" UI components without using the Infragistics (smaller install? almost no DLLs).

I was wondering if there is a tool/plugin that will list the Name property (possibly more) of all the components/elements in a given WinForm?

C# MVS2008

mastofact
  • 540
  • 1
  • 6
  • 23

3 Answers3

7

It is built into Visual Studio. View + (Other Windows) + Document Outline. Open the form in design mode. It shows a list of all the controls and components you have in the form with Name and Type.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
0

Most likely, there was a reason, why the previous developer used Infragistics. Those control libraries offer more functionality than the default WinForms controls. If he used that advanced functionality, you can't simply replace them, because there is no corresponding functionality in the WinForms control. Including the DLLs isn't really a problem, and if it is, just merge them into your EXE using ilmerge... This will reduce the number of files you need to deploy.

Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443
  • I was taking into account of what you said, but don't see any additional functionality that can't be done using regular controls. This is a basic "Configuration" window: text boxes, numerical entries, radio/check boxes, buttons. Thanks for your suggestion with ILMerge, I'll look into that. – mastofact Apr 05 '11 at 15:09
0

Well, you can create such a tool very easily on your own, here is a C# example of how to get a list of all controls of a WinForm:

    public static List<Control> FindAllControls(Control container)
    {
        List<Control> controlList = new List<Control>();
        FindAllControls(container, controlList);
        return controlList;
    }

    private static void FindAllControls(Control container, List<Control> ctrlList)
    {
        foreach (Control ctrl in container.Controls)
        {
            if (ctrl.Controls.Count == 0)
                ctrlList.Add(ctrl);
            else
                FindAllControls(ctrl, ctrlList);
        }
    }

Of course, you have to place a call var lst = FindAllControls(theForm) somewhere into your program and process the results.

Doc Brown
  • 19,739
  • 7
  • 52
  • 88