|
-
Mar 19th, 2000, 09:05 AM
#1
Thread Starter
New Member
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
-
Mar 19th, 2000, 09:56 AM
#2
Lively Member
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.
-
Mar 19th, 2000, 10:02 AM
#3
Frenzied Member
Here ya go...
I don't remember where I got this, but it works...
Code:
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
Mess around with the CreateEllipticRgn arguments to change the shape of the form
-
Mar 19th, 2000, 10:12 AM
#4
Lively Member
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)
-
Mar 19th, 2000, 10:37 AM
#5
Thread Starter
New Member
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 ! =)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|