Beecontrol for Renderer
To draw a bee on your form.
With a beecontrol
And two forms. Now you only need to place the bees in one way, move them from one form to another, and record their existence. You also need
Filedform
Put the flowers on, but the flowers do not move, this is very simple. These codes can all be put into a new class,
Renderer
. The following are the responsibilities of this class:
① The statistical data form will be the parent form of the honeycomb form and pastoral form
Add two forms to the project, hiveform
And
Filedform
. Then add code in the constructor of the main form to display its subforms and notify
Windows
The statistic form is their owner.
Child forms are minimized along with the parent form.
② The Renderer contains
And reference of each sub-Form
The Renderer needs to know the location of each bee and each flower, so it needs world
. It needs to remove and add controls in the child form, so it also needs to reference the child form:
③ The Renderer uses dictionaries to record controls
World
List
To record flowers and bees. The Renderer needs to record both the flowers and bees and the corresponding one.
Beecontrol
And
Picturebox --
Alternatively, if the corresponding control is not found, you need to create one. So this is an excellent opportunity to use the dictionary. So
Renderer
Class also requires two fields: