how can i change the shape of my form to letz say...an oval, instead of having a rectangle?
i'm doing this in vb4
Printable View
how can i change the shape of my form to letz say...an oval, instead of having a rectangle?
i'm doing this in vb4
i don't remember the exact function names but this will give you an idea:
use: SetWindowRgn, CreateEllipticalRgn & SetWindowPos
1. Create an elliptical region using CreateEllipticalRgn.
2. Set the forms region using the created region.
3. Refresh your form using setwindowpos.
Sorry, for not giving the complete code. I don't remember my functions.
I don't remember where I got this, but it works...
Mess around with the CreateEllipticRgn arguments to change the shape of the formCode: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 Boolean) As Long
Private Sub Form_Load()
Me.Show 'Show the form
SetWindowRgn hWnd, CreateEllipticRgn(0, 0, 300, 200), True
End Sub
that's it! if you want to create a different shape other than ellipse, you can use other api functions for creating regions. (functions with the 'Rgn' suffixes)
i used your code seaweed, but it keeps saying CreateEllipticRgn isnt defined
do i define as long?
and when i define as long i get an expected array
in desparate need! help ! =)