|
-
May 30th, 2007, 04:23 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Transparent form with borders visible
Hi, there are hundreds of threads here about making forms transparent, but I can't find any threads that show how to make a form transparent and keep the borders visible.
Is it possible to do this?
Using "SetWindowLong" with the borderstyle property set to 1 - 5 doesn't work.
Last edited by Chris001; May 30th, 2007 at 04:25 PM.
Reason: typo
-
May 30th, 2007, 04:28 PM
#2
Re: Transparent form with borders visible
It's because the border is part of the form. Try searching the forums i think Bushmobile has some samples.
-
May 31st, 2007, 01:03 AM
#3
-
May 31st, 2007, 01:09 AM
#4
Re: Transparent form with borders visible
oh , i guess your talking about TransClusion
-
May 31st, 2007, 01:27 AM
#5
Re: Transparent form with borders visible
-
May 31st, 2007, 03:19 AM
#6
Addicted Member
Re: Transparent form with borders visible
yeah i remember i experimented one like this, i put a BLUE picture on the form and then make that BLUE the transparent color. Fazi has the declarations on his transparent form.
Code:
Dim Ret As Long
Dim CLR As Long
CLR = RGB(0, 0, 255) 'this color is the color that will be transparent
'Set the window style to 'Layered'
Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret
'Set the opacity of the layered window to 128
SetLayeredWindowAttributes Me.hWnd, CLR, 0, LWA_COLORKEY
-
May 31st, 2007, 04:02 AM
#7
-
May 31st, 2007, 04:28 AM
#8
-
May 31st, 2007, 04:55 AM
#9
Re: Transparent form with borders visible
Thanks iPrank,
This is the second time i guess you have pointed out Missing Option Explicit.
I often make this mistake Prank. Sorry. i should correct this from this minute.
Ctrl + F5 : Truly i have never use it. Thanks for the Tip.
-
May 31st, 2007, 05:25 AM
#10
Re: Transparent form with borders visible
You don't need to write option Explicit manually.
Click Tools>Options... menu.
In the Editor tab check "Require Variable Declaration".
Click OK.
Now whenever you open a new code window, VB will autometically add Option Explicit in your code.
-
May 31st, 2007, 05:47 AM
#11
Member
Re: Transparent form with borders visible
 Originally Posted by iPrank
You don't need to write option Explicit manually.
Click Tools>Options... menu.
In the Editor tab check "Require Variable Declaration".
Click OK.
Now whenever you open a new code window, VB will autometically add Option Explicit in your code.
Great Tip iPrank. So i will not going to miss 'Option Explicit' after this Thank You.
-
May 31st, 2007, 06:02 AM
#12
Re: Transparent form with borders visible
You're welcome.
-
May 31st, 2007, 10:47 AM
#13
Banned
Re: Transparent form with borders visible
 Originally Posted by iPrank
Thanks for the info
-
May 31st, 2007, 03:54 PM
#14
Thread Starter
Frenzied Member
Re: Transparent form with borders visible
Thank you very much, Fazi. That's great!
Last edited by Chris001; May 31st, 2007 at 04:00 PM.
-
May 31st, 2007, 05:17 PM
#15
Re: Transparent form with borders visible
 Originally Posted by iPrank
You don't need to write option Explicit manually.
Click Tools>Options... menu.
In the Editor tab check "Require Variable Declaration".
Click OK.
Now whenever you open a new code window, VB will autometically add Option Explicit in your code.
Except in the default form's code window when you run VB6, or am I the exception?
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
May 31st, 2007, 05:26 PM
#16
Re: Transparent form with borders visible
 Originally Posted by Al42
Except in the default form's code window when you run VB6, or am I the exception?
It will not add anything to already existing code modules.
It will work on every NEW code module (form/class/bas module/User control) you add.
Just close and re-open VB and create a new project. Double click the form and see what happens.
-
May 31st, 2007, 05:33 PM
#17
Re: [RESOLVED] Transparent form with borders visible
If I opened VB from a cold start and selected VB Pro Edition Controls, I wouldn't get Option Explicit at the top of Form1's code window. You forced me to do a little research. My Form1 template was damaged. Thanks for forcing me to fix it.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
May 31st, 2007, 09:17 PM
#18
-
Jun 9th, 2007, 06:25 PM
#19
Banned
Re: Transparent form with borders visible
 Originally Posted by Fazi
Thanks Chris, iPrank  and every one 
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
|