CSHARP, C #, GDI +

Source: Internet
Author: User

At the beginning, I want to isolate the drawn rice child box from the master form1 to write, mainly for the sake of transaction separation, and want to write in tianzikuang. in the CS file, define a method for drawing the rice box drawtianzikuang (paintargs E), create a new object in the main form, and reference the painting method of the new object, the result is hard to draw. I have consulted some people and said that the on_paint () method must be defined in the panel, that is, form, so that the painting can be done. Do you know if it is necessary to write it like this? If you forget to see it, please advise me.

Later, you can only define variables, attributes, and painting methods in the form, but there is a problem. For better readability of the program, the rendering method is defined as public void tianzikuang_onpaint (paintargs E) {....}, I still cannot draw it at the end. I think the Form class has its own on_paint () method. Do I need to load the custom painting method in the class initialization place?, The result is added to the form1.designer. CS file:

This. Paint + = new system. Windows. Forms. painteventhandler (this. onpaint_drawtian );;

Drawing is successful, and new users cannot afford to be hurt... (it depends entirely on memories and will be revised and released tomorrow)

Make persistent efforts...

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.