C# Tutorial – Create a bubbles particle system using Paint, Windows Form and Visual Studio

Hi, in this tutorial we will demonstrate how to create a simple bubble particle system using native C# and Windows Form. When we talk about windows form application you can imagine a nice image gallery, drop down application, office application or a calculator. No one really wants to do a lot of graphics with windows form because in all honesty its not made for that. But just because its not made for it, it don’t mean it cant do it.  In this tutorial we will explore how to make a particle system inside of windows form that looks great (work with transparency, decent frame rate, use multiple graphics) and works even better (dynamically draw objects to the screen, control the objects using OOP etc).

 

Lesson objective –

  1. Make a windows form bubbles particle system in visual studio
  2. use only native c# programming to complete the application
  3. use transparent PNG images as bubbles on the screen
  4. use the paint event and timer event to achieve the desired results
  5. create a Bubble CLASS in visual studio and instantiate the bubbles with custom instructions dynamically
  6. control the bubble movements and positioning directly on the individual bubble class
  7. change background image using the Z key on the keyboard
  8. switch between background images in real time as the particles are playing in the foreground

Video Tutorial –

 

Download particle images and the backgrounds here

 

Form1.cs source code

 

Bubble Class Source Code –




Comment on this tutorial and let us know how you got on -