Basic Paint Banner Image

Basic Paint in VB6

Let’s do something fun with VB6!

Let’s try to create a Paint application!

As soon as I learned about PictureBox in VB6, I’ve always wondered how to create an application like MS Paint, but start with something super basic — just be able to draw something on the PictureBox.

Decades ago I created that but I can’t find the codes anymore so I thought, I’d just create one again 🙂

User Interface

So here’s what the application looks like (it’s super simple, yes):

For now it has the color palette on top and the canvas (which resizes with the window). I’ve also added some file operations menu.

Color Palette

The color palette box is where you change the brush color. I’ve also added a selection box in the color palette whenever you click one of the colors cause Command Buttons don’t exactly have a built-in clue that it’s the last one you clicked.

I tried radio (or Option) button and set the Style to Graphical, but when it’s clicked/selected, the color changes and so I just thought I’d just add that border around the selected color for a visual cue.

File Menu

I thought this Paint App would not be that useful if you can’t save your art and/or load them afterwards so I added those basic file operations too. The actions are all basic, but enough for my initial version so that you can:

  • Create a New canvas (or drawing)
  • Open a saved image (Bitmap only)
  • Save your work or progress
  • Save to a different filename (Save As)

I used the Common Dialog box for loading and saving operations, asking the user for the filename:

This is just a fun project for me and you might want to do something like this from time to time if you’re starting to get bored or burnt out of your typical daily routine, plus this challenge would teach you a lot of things and maybe even find a new appreciation to what VB6 can do, even in 2022! 🙂

I’ll post the source codes some other time. I must put comments on them and make them look good before I upload them so it would be easy for you to follow and use as reference or even a starting point for your next project. 🙂

Code Update!

Codes with comments are now at this GitHub link:

https://github.com/vegitz/codes/tree/master/0020%20Basic%20Paint%20in%20VB6

Enjoy and keep exploring and learning!

Leave a Comment