Find control by name from Windows Forms controls

前端 未结 3 973
甜味超标
甜味超标 2020-11-22 08:03

I have a list of my textbox names, and I want to find a control by name. How is it possible?

3条回答
  •  天命终不由人
    2020-11-22 08:08

    You can use:

    f.Controls[name];
    

    Where f is your form variable. That gives you the control with name name.

提交回复
热议问题