Enumerate .Net control's items generically (MenuStrip, ToolStrip, StatusStrip)

后端 未结 3 1965
北恋
北恋 2020-12-17 06:40

I\'ve got some code that will generically get all Controls in a form and put them in a list. Here\'s some of the code:

        private List Ge         


        
3条回答
  •  既然无缘
    2020-12-17 07:30

    The items such as ToolStripItem etc aren't actually controls, they are simply components that make up a ToolStrip or MenuStrip.

    Which means, that if you want to include those components in your flattened list of controls then you will need to do the specific checks.

提交回复
热议问题