Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to get the control according to the control Id and operate on the control

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "how to get the control according to the control Id and operate the control". In the daily operation, it is believed that many people have doubts about how to get the control according to the control Id and operate the control. The editor consulted all kinds of materials and sorted out a simple and useful operation method. I hope it will be helpful for you to answer the question of "how to get a control according to the control Id and operate on the control"! Next, please follow the editor to study!

When doing dynamic acquisition of a control, it is often necessary to get the control according to Id and operate on it, using the

The copy code is as follows:

/ / /

/ / get the control according to the control id

/ / /

/ / /

/ / /

Private Control GetControl (string name)

{

Object o = this.GetType () .GetField (name, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.IgnoreCase) .GetValue (this)

Return ((Control) o)

}

This method can quickly find the control.

At this point, the study on "how to get the control according to the control Id and operate on the control" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report