473,508 Members | 4,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Transparent Form...

Ali Rizwan
925 Contributor
Hi all,
I know how to make a form transparent and how to create fadein and out effects on forms and controls both. But i dont know how can i make a form transparent but the controls are not transparent they must be visible. Or you can say i want to make my form transparent but i dont want to make controls on the form transparent.

Thanx
>> ALI <<
May 9 '08 #1
8 3163
Dököll
2,364 Recognized Expert Top Contributor
Hi all,
I know how to make a form transparent and how to create fadein and out effects on forms and controls both. But i dont know how can i make a form transparent but the controls are not transparent they must be visible. Or you can say i want to make my form transparent but i dont want to make controls on the form transparent.

Thanx
>> ALI <<
What type of controls are you referring to, Ali? And why do they need to remain transparent. Perhaps there is another way to achieve if you could cpould post the working code.

In a bit!

Dököll
May 11 '08 #2
Ali Rizwan
925 Contributor
What type of controls are you referring to, Ali? And why do they need to remain transparent. Perhaps there is another way to achieve if you could cpould post the working code.

In a bit!

Dököll
The code is large. You can check my code in How to section. I have posted my codes to fade or making transparent form and controls.
But i dont want it that way. When i use that code form make transparent itself and all the controls on it. but i dont want to make controls trasparent.

Thanx
>> ALI <<
May 14 '08 #3
daniel aristidou
491 Contributor
Hey ali.
In newer versions of vb.
Set the background colour to a colour unused in the rest of your controls.
Then under the forms properties set the "Transparency colour/key" equal to that of your form.

i think you are using vb6.....which means...complications....and therfore this probably is not an option
May 14 '08 #4
jamesd0142
469 Contributor
Hey ali.
In newer versions of vb.
Set the background colour to a colour unused in the rest of your controls.
Then under the forms properties set the "Transparency colour/key" equal to that of your form.

i think you are using vb6.....which means...complications....and therfore this probably is not an option

Wow i tested this in vb2005, its neat!

James
May 14 '08 #5
Ali Rizwan
925 Contributor
James and deniel i know and i have done this a long time ago in vb2008 by setting form's transperent color. I got an idea about doing it in vb6.

I ll upload a file but the way i m trying to do is a bit different, But stiil there is a problem i want to make the form semitransperent not completely transperent. and i knw this cannot be done in vb2008 too.

Thanx
>> ALI <<
May 14 '08 #6
daniel aristidou
491 Contributor
i want to make the form semitransperent not completely transperent. and i knw this cannot be done in vb2008 too.

Thanx
>> ALI <<
Ali i think it can be done in vb08:
using silverlight.
insert a WPF user control..and this allows you to set a transparency% and amazing graphics....and shadows...etc.
Or you could convert your application:
instead of windows application
select Presentation application.
May 15 '08 #7
shuvo2k6
68 New Member
Ali i think it can be done in vb08:
using silverlight.
insert a WPF user control..and this allows you to set a transparency% and amazing graphics....and shadows...etc.
Or you could convert your application:
instead of windows application
select Presentation application.

Try by this:
Expand|Select|Wrap|Line Numbers
  1. Private Const GWL_EXSTYLE As Long = -20
  2. Private Const WS_EX_LAYERED As Long = &H80000  
  3. Private Const LWA_ALPHA As Long = &H2  
  4. Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long  Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long  
  5. Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long  
  6. Private Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long  
  7. Dim alpha As Integer  
  8. Const MAXALPHA As Integer = 250  
  9. Const MINALPHA As Integer = 0  
  10. Private Sub SetTrans(ByVal OB_Hwnd As Long, ByVal OB_Val As Integer)  On Error Resume Next     
  11. Dim Attrib As Long     
  12. Attrib = GetWindowLong(OB_Hwnd, GWL_EXSTYLE)     
  13. SetWindowLong OB_Hwnd, GWL_EXSTYLE, Attrib Or WS_EX_LAYERED     SetLayeredWindowAttributes OB_Hwnd, RGB(0, 0, 0), OB_Val, LWA_ALPHA     
  14. FTransVal = OB_Val     
  15. Exit Sub 
  16. End Sub  
  17. Private Sub Command1_Click()  
  18. If MAXALPHA = alpha Then  
  19. Exit Sub  
  20. End If  
  21. SetTrans Me.hwnd, alpha  
  22. alpha = alpha + 10  
  23. End Sub  Private 
  24. Sub Command2_Click()  
  25. If MINALPHA = alpha Then  
  26. Exit Sub 
  27. End If  
  28. SetTrans Me.hwnd, alpha  
  29. alpha = alpha - 10  
  30. End Sub  
  31. Private Sub Form_Load()  
  32. alpha = MAXALPHA  
  33. End Sub  
  34.  
May 15 '08 #8
Ali Rizwan
925 Contributor
Are you sure this will set transperency to form only not to controls.

Thanx
>> ALI <<
May 15 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1822
by: Graphics_master | last post by:
Anyone know how to create a transparent splash screen similar to Photoshop, After Effects, or premiere. They have a wonderful transparent look. I realize that I can use the key color property of...
9
7797
by: don | last post by:
I want to create a transparent form and can write something on it by using Ink. I try to set form.backcolor = color.transparent, but it dosen't accept. And everything will be transprent when i use...
3
3093
by: Steve Koon | last post by:
Any thoughts on getting this project to work or suggesting another method would be appreciated. Steve ========================================== Project: A Windows Form which acts as a...
8
10583
by: Grahammer | last post by:
Is it possible to set the background of a usercontrol as transparent? I tried setting the background image of the usercontrol to a transparent GIF, but that caused MAJOR problems. I'm making...
0
4461
by: Henry Wu | last post by:
Hi, I am aware that TransparencyKey only works with top-level forms or Non-MDI Child Forms, if one tries to set the opacity or transparencykey property to a MDI-Child form, it will have no effect....
4
2541
by: jcrouse | last post by:
I am using the following code to move a label on a form at runtime: If myMousedown = lblP1JoyRight.Name Then If lblP1JoyRight.BackColor.Equals(Color.Transparent) Then bTransCk = True ...
2
7571
by: Dean Slindee | last post by:
It appears that I have two routines that don't play well together! First routine: a form's background is shaded with a gradient color. Second routine: then, the background of all labels on the...
1
3036
by: FredC | last post by:
I'm using VS 2003, C#.Net 2003. I built a simple windows form app. with the following attributes: - has a BackgroundImage set to a jpeg I built a very simple user control that contains a...
4
9330
by: ray well | last post by:
in my app i need to make a RichTextbox control transparent. i need it to be a like a pane of glass lying on a sheet of paper, where u can see everything on the sheet of paper not covered by text...
8
10144
by: Brian Ward | last post by:
I am looking for a simple way to set the image transparency in a PictureBox. I have a moving PictureBox containing a graphic image .. moving by incrementing its Left property. The background...
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.