Use of the PropertyGrid control in C # In WinForm debugging

Source: Internet
Author: User

PropertyGrid provides a user interface for browsing object properties. On the WinForm design page, click a control and select the "properties" page. The properties and values of the control are displayed. The PropertyGrid control is used to display the information.

When designing and debugging the WinForm program, when you need to modify the properties of the control, such as the text color, background color, and text content, you can only stop debugging and reset the properties before debugging; sometimes you need to obtain attributes that cannot be directly displayed by the control, such as position, size, and Padding. You can only set breakpoint viewing.

In fact, these can be implemented through the PropertyGrid control.

For example, if your form contains a button button1 and you need to know the font, color, and position, you can place a PropertyGrid control in the proper position of your form and set PropertyGrid. selectedObject = button1; run your program. When you modify the font in PropertyGrid, you will find that the font of button1 has been changed. If there is other code, set button1.Enable to false, you can also see it in PropertyGrid, or even change it back to true!

Therefore, the use of PropertyGrid can improve the debugging efficiency of the WinForm program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.