Solved

Windowless VB Forms

Posted on 1998-06-02
15
263 Views
Last Modified: 2008-02-01
Does anyone know how to make a vb form transparent still showing just say an image.
0
Comment
Question by:FGrist
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +5
15 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1462324
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.
0
 

Expert Comment

by:topol
ID: 1462325
You can make your form custom size, not a rectangle, but let's say a circle.
0
 
LVL 3

Expert Comment

by:schworak
ID: 1462326
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:topol
ID: 1462327
shworak, I can send you the sample application showing how to make the form any shape you want.
0
 
LVL 1

Expert Comment

by:Edithf
ID: 1462328
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
0
 
LVL 3

Expert Comment

by:schworak
ID: 1462329
To Topol,

Yes! I would love that sample code too please.

glenn@g-world.com
0
 

Author Comment

by:FGrist
ID: 1462330
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.
0
 
LVL 2

Expert Comment

by:ndnet
ID: 1462331
Topol, could you send me the code too.
sgmcnaughton@hotmail.com
0
 
LVL 2

Accepted Solution

by:
ndnet earned 100 total points
ID: 1462332
ActiveX to the rescue:
http://www.cariblife.com/pub/FSActiveX/index.html
is the address to a control that does just that.
0
 
LVL 4

Expert Comment

by:martinag
ID: 1462333
Topol, I'd like to have that code too.
martin.agren@home.se
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1462334
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
0
 
LVL 1

Expert Comment

by:sirigere
ID: 1462335
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
0
 
LVL 1

Expert Comment

by:sirigere
ID: 1462336
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.
0
 

Expert Comment

by:topol
ID: 1462337
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!!!
0
 

Author Comment

by:FGrist
ID: 1462338
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
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question