Does anyone nows how to make window to apear not squaer ????
Printable View
Does anyone nows how to make window to apear not squaer ????
Try thisVB 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
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!
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).
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...
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.
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...
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.