|
-
Apr 11th, 2002, 06:36 AM
#1
Thread Starter
New Member
A "not square" window ?!
Does anyone nows how to make window to apear not squaer ????
-
Apr 11th, 2002, 07:04 AM
#2
Try this
VB Code:
Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 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 Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long
Private Sub Form_Load()
Dim fwidth As Long, fheight As Long
Dim rval As Long, nhwnd As Long
fwidth = Me.Width / Screen.TwipsPerPixelX
fheight = Me.Height / Screen.TwipsPerPixelY
'Create Round Rectangular Region
nhwnd = CreateRoundRectRgn(0, 0, fwidth - 25, fheight - 25, fwidth - 50, fheight - 50)
'Create Elliptic Region
'nhwnd = CreateRoundRectRgn(0, 0, fwidth - 50, fheight - 50, fwidth - 50, fheight - 50)
'Set Round Rectangular Region on form
rval = SetWindowRgn(Me.hWnd, nhwnd, True)
rval = DeleteObject(nhwnd)
End Sub
-
Apr 11th, 2002, 07:38 AM
#3
Frenzied Member
mlewis posted an excellent example on that somewhere lately. you should search for it, you can use a bmp and set one color as the one to be transparent... it's pretty neat!
Sanity is a full time job
Puh das war harter Stoff!
-
Apr 11th, 2002, 10:01 AM
#4
Fanatic Member
I have an OCX which allows you to make the form invisibale except the controls on it (label and imagebox will be invisable).
It allows you to do more then this too. Some stuff it allows:
-Tiled Background Images
-Flashing Caption
-Min/Max Size (maximize free cell to see what I mean)
-A few more options, which I can't rember
If you wish, I will upload it when I get home (don't know if this is what you want though).
-
Apr 11th, 2002, 10:13 AM
#5
Frenzied Member
I am not sure but I think you could archieve the same thing (not showing the form at all) by setting the region of it to 0... I am not sure though.. if not it was something similar...
Sanity is a full time job
Puh das war harter Stoff!
-
Apr 11th, 2002, 11:17 AM
#6
Fanatic Member
I know that there are other ways, but the control allows you to do more, and easier, with the control then with any one API.
-
Apr 11th, 2002, 12:15 PM
#7
Frenzied Member
that's true. I just think it's always better to use API instead of Controls! Controls are not your code (well that is not a big problem if they are free) , but I hate them because if you transfer the tinyest program you need to install those too and I really don't like spamming the windows directory...
Sanity is a full time job
Puh das war harter Stoff!
-
Apr 11th, 2002, 05:38 PM
#8
Fanatic Member
I know what you mean, and this one was downloaded as freeware. The nice thing about controls (and dlls), is that you only need one copy of it. If you write your own code (not in a dll or control), you have to install it each time the program is setup. A dll or control only needs to be installed once, although you still should include it in each program which uses it.
Anyways, I attached the control to this post.
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
|