Link to home
Start Free TrialLog in
Avatar of FGrist
FGrist

asked on

Windowless VB Forms

Does anyone know how to make a vb form transparent still showing just say an image.
Avatar of martinag
martinag

Transparent forms may mess up the screen.

You could instead try setting BorderStyle to 0 and make the form just the size of the image.
You can make your form custom size, not a rectangle, but let's say a circle.
It is also posible to do a screen grab and use that as the background of an "Always On Top" form that is maximized with no borders or menue items. That would fool the user into thinking the form is not visible and any controlls are floating over their desktop.

I don't konw how to make the form a circle, but that would be quite interesting to see!

This is an interesting idea and I would love to see the end answer that you come up with.
shworak, I can send you the sample application showing how to make the form any shape you want.
To Topol,

Can you pls send me a copy of the smple application showing how to make the form different shape ? I am very interested in it :)

My email is : edith-f@usa.net
To Topol,

Yes! I would love that sample code too please.

glenn@g-world.com
Avatar of FGrist

ASKER

From Fred to all: I am new to this group so I hope this is the right way to respond. Fist thankyou to all. The App I saw do this was a vb clock. There
was definetly no other background around the clock until you dblclk then the form shows up or dissappears depending on the toggle. Topol's idea sounds good. Topol I have used the SetwindowRect thing and it does'st form a really weired shape like a this clock.
I am not sure what you have in mind but I am very Intersted.
My E-Mail is zyron@rogers.wave.ca.
Topol, could you send me the code too.
sgmcnaughton@hotmail.com
ASKER CERTIFIED SOLUTION
Avatar of ndnet
ndnet

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Topol, I'd like to have that code too.
martin.agren@home.se
Hi, everyone, this is the code for making the windows:
Regards
Dalin

                  ' This goes into the General Declarations section:
                             
                           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()
                             Show 'The form!
                             SetWindowRgn hWnd, _
                             CreateEllipticRgn(0, 0, 300, 200), _
                             True
                           End Sub
To Topol,

     Can you pls send me a copy of the sample application showing how to make
     the form different shape ? I really appriciate that.
my email : sirigere@usa.net
You can achive the transperancy just by fooling
Grab the screen and load it on the form. I assume that the form you crete will be with out any caption, min,max and control( i maen disable those properties). Then place a image control which ofcoures will be transparent and load the image into the image control. I think it meight solve your prob to some extent.
Good news for all who want to see how to make a form different shape.
Go to URL http://www.mvps.org/vb/ and get WinRgn.zip there.
I tried it-- you should take a look at that sample too!!!
Avatar of FGrist

ASKER

nDNet: This ocx is the answer it does the job. It is proof it can be done.

dalin: your code creates shapes however seems limited to geometric shapes

topol: Your code is an enhanced version of dalin's and works with a little mathematical improvisions.. thankyou good stuff

sirigere: the grab won't work fully because in the sample I saw the desktop is still active everwhere.

Thankyou to all

PS: If someone could e-mail at zyron@rogers.wave.ca to explain more details on this usergroup eg. how the points work how to get more and how to help others I would appreciate it