Automatic Form Shaper

By | 2002-06-01

This code will shape a form based on it’s .Picture property. It uses a transparent color and makes all areas of the form which is that color transparent. Extremely useful for programs to incorporate custom Themes. This code works best with smaller forms. The bigger the form, and the more complex of an image you use for the background, the slower the code will go. The image I provided in the example is rather complex (the logo for my company), so you will notice a slight delay when the form loads.

Original Author: Chris Yates

Inputs

The name of the form, and an RGB value of the transparent color in your picture. A good color to use for your transparency is bright purple (R:255 G:0 B:255) because most pictures do not use this color.

Assumptions

The best thing to use this code for is forms without titlebars and to give your application a more unique and custom look. Don’t forget to add a button to close / minimize your program. It is not recommended to have a maximize button because of how you are limiting the window to a specific region.

Returns

Nothing

Side Effects

This code works best with smaller forms. The bigger the form, and the more complex of an image you use for the background, the slower the code will go. The image I provided in the example is rather complex (the logo for my company), so you will notice a slight delay when the form loads.

Attachments

FileUploadedSize
CODE_UPLOAD1829.zip9/3/2020 3:45:00 PM7775
Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.