Try to write the Form Designer (2) propertygrid

Source: Internet
Author: User

If you want to modify this design Form Other attributes? The next step is simpler.
Switch Form1 Design Interface, put Splitcontainer, Here again Splitcontainer Right Panel Put Propertygrid, And Dock Set the property value Fill .


SwitchCodeEdit the page and change the last line of the code entered in the previous article:

This . Splitcontainer1.panel1. Controls. Add (View );

Add one line:

This . Propertygrid1.selectedobject = Surface. componentcontainer. components [ 0 ];

Run the project and edit it now.At design timeForm.

 

In addition to a little drag-and-drop operation, I only wrote six lines of code to implement this function. Is it interesting?

My goal in this topic is to write a usable form designer. What is the purpose? For exampleProgramAfter the release, the user feels that the position of a control needs to be adjusted, and the font color of a control needs to be modified. It does not matter. You can modify the font color on your own. The more complex application is that the user wants to add a field to a document. It doesn't matter. The user or implementer can add the field by themselves. Do not change the code or re-compile the code. Even if users want to add some processing, they can also write code in the designer by the implementer. The system can compile the code and call it at runtime.

Related chapters:
WriteFormDesigner Attempt(I)

Next preview:WriteFormDesigner Attempt(3.)Add controls to the form.

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.