First and foremost, teach you kids to take interest in non-funky stuff. This way, you will send an important message: most interesting things lie much deeper then the outer shell. Make your application really
interesting, not due to funky colors and shapes. If you need to educate good taste, first learn good taste by yourself. This is not easy, but when you get it (I don't know hot to tell you are ready though, many never ever come to it
), you will know yourself what you can do.
Now, back to technical issues. This is a pretty big topic. All graphics is rendered in handling of the Windows message WM_PAINT. The window does not store any information on the graphics, so if a part of a form is closed by the other window, and then shown again, it will send you the message again. To handle it, you need to override the method
or handle the event
. Don't repeat the common mistake: use the instance of
passed to you in the event arguments, don't create an instance.
For animated or interactive behavior, you need to change data used in rendering and invalidate the scene using
. You can use
with parameters (
) to invalidate only a part of the scene and avoid excessive redrawing, to improve performance.
Using these techniques, you can render arbitrary image in custom controls (including
) and implement animation.
Drawing Lines between mdi child forms
capture the drawing on a panel
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))
For animation, you will need to develop a moving scenario using a separate thread. Basically, you need to have some data representing the scene or its parameters. In the thread, you should change this data step by step. On each step, you need to notify the UI thread on the change, so the scene could be fully or partially re-drawn, via a call to
. The problem is that you cannot call anything related to UI from non-UI thread. Instead, you need to use the method
(for both Forms or WPF) or
You will find detailed explanation of how it works and code samples in my past answers:
Control.Invoke() vs. Control.BeginInvoke()
Problem with Treeview Scanner And MD5
See also more references on threading:
How to get a keydown event to operate on a different thread in vb.net
Control events not firing after enable disable + multithreading
To avoid flicker in animated or interactive rendering, always use double buffering
There is one more interesting thing you can use: non-rectangular controls, including forms. To have them, you simply need to assign its property
to some non-rectangular
instance. Please see:
This is not so simple and will need some practice. I would advise not to afraid it. Speaking of your "more by my son than me": you would never interest your son in this stuff you are not really interested by yourself. So, huge perseverance and perfectionism is not a bad thing at all.
There is a simpler alternative though, if you switch to WPF from Forms. There are different levels of imagine in WPF, but almost everything I mentioned before is already done for you: animation, rendering, zooming/panning and a lot more. Basically, instead of handling events, you can simply have an instance of the
, put all kinds of objects on it and move them around. Please see:
On top of it, you could have animations. Please see:
Of course, you can always do self-made animation, to model more complex motion, with thread. You need to do it the same way I described above, with UI thread invocation mechanism.
This is just one WPF approach, but it looks like it's the closest to what you want.
Now, it leaves for sounds. You see, my answer is already too big for this forum. Consider this first, ask you follow-up questions. Sounds are easier and do not depend on the UI library. Let me find some more time later, to write about them…