We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Windowless VB Forms

FGrist asked
Medium Priority
Last Modified: 2008-02-01
Does anyone know how to make a vb form transparent still showing just say an image.
Watch Question

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.



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.
Unlock this solution and get a sample of our free trial.
(No credit card required)

Topol, I'd like to have that code too.

Hi, everyone, this is the code for making the windows:

                  ' 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), _
                           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!!!


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
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.