VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Excellent Custom Form Shape Routine

Steve Nunnally  (1 Submission)   Custom Controls/Forms/Menus   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

After putting a picture on your form, run this code and whatever background color you choose will be subtracted from the form leaving a very custom form shape.

Assumes
You must have a picture on your form, and you must have the correct color value for the transparent area of your form. Most paint programs usually tell you the red/green/blue values of a color.

API Declarations
Type POINTAPI
x As Long
y As Long
End Type
Declare Function ReleaseCapture Lib "user32" () As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Declare Function CreateRectRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long

Rate Excellent Custom Form Shape Routine (2(2 Vote))
Excellent Custom Form Shape Routine.bas

Excellent Custom Form Shape Routine Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters