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...