some application can define it's form's shape by a bitmap'mask color (e.g. K-JOFOL,it' skin bitmap's magenta area make the form transparent).Can I do it with VB
Printable View
some application can define it's form's shape by a bitmap'mask color (e.g. K-JOFOL,it' skin bitmap's magenta area make the form transparent).Can I do it with VB
There is a control that does exactly this, you can get it from hypermart.mozzysoft.com .Don't quote me on that. Andway, if you can't find it there, then it'll be on vbaccelerator.com.
Hope you find it, I think it's called from-shaper or something.
:):):):):):):):):):):):):):):):):):):)
much easier way. Check this out:
Option Explicit
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Private Sub Form_Load()
Dim hr&, dl&
Dim usew&, useh&
usew& = form1.Width / Screen.TwipsPerPixelX
useh& = form1.Height / Screen.TwipsPerPixelY
hr& = CreateEllipticRgn(0, 0, usew, useh)
dl& = SetWindowRgn(form1.hWnd, hr, True)
End Sub
You can reshape forms, buttons, etc. with this api call.
Be sure and put it in the form_resize event as well, if applicable.
Simply give the api call the handle to a region you created with any number of different api calls:
CreateEllipticRgn
CreatePolygonRgn
CreateRectRgn
Note: be sure to delete the region with DeleteObject api call when done with it. Otherwise, byebye resources. There are many ways to manipulate a region, even combine 2 of them in an and/or etc. (CombineRgn - duh)
Have Fun! Experiment! Create forms with holes in them, etc! This is another often-overlooked function that is fun for the whole family! etc. etc. you get the idea...