lankean
lankean

Reputation: 11

HOW get all controls in designer.cs file of windows form?

i want to retrieve all of the controls in specific windows form. im thinking to get all of them in the file designer.cs(ex:form1.designer.cs). i know some here maybe thinking just foreach loop controls in form1.controls but not like that.Currently im opening the designer.cs file in richtextbox but somehow did not meet my requirement i just want to retrieve the controls on that file

Upvotes: 1

Views: 1190

Answers (1)

Guru Kara
Guru Kara

Reputation: 6462

I Assume by designer.cs you mean all the controls in you Form(WindowsForm)

You need to recursively query for all the controls in the Form Here are two links which will help you get what you are asking for.

How can I query all Childcontrols of a Winform recursively?

How to get ALL child controls of a Windows Forms form of a specific type (Button/Textbox)?

Upvotes: 1

Related Questions