4 Replies - 6891 Views - Last Post: 23 August 2012 - 12:19 PM Rate Topic: -----

#1 lemonq  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 15-February 12

Transparent form, but controls visible

Posted 16 February 2012 - 12:25 PM

I am having trouble finding a way to make the form transparent but the controls still visible. The only transparency I have been able to get to work on the form is
Me.Opacity = <value between 0 and 1>

but that affects all the controls on the form
Is there a way to make the controls not inherit this property from the form?
Is there another way to make the form transparent?
I have buttons and a checkbox that I don't want to be affected by the transparency at all, and a picturebox that I do want to be able to control the level of transparency. Currently, I'm using a slider bar, and controlling the opacity of the form, but that makes everything on the form transparent. I'd actually like for the form itself to be completely invisible, and for my slider bar to control the opacity of the picturebox only.
Does anyone have an idea how I might accomplish this?

Is This A Good Question/Topic? 0
  • +

Replies To: Transparent form, but controls visible

#2 Psyguy  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 75
  • View blog
  • Posts: 323
  • Joined: 12-January 11

Re: Transparent form, but controls visible

Posted 16 February 2012 - 01:38 PM

There is a form property, whereby you can set a Transparency Key to a specific color. The color you set it to then becomes "transparent" when the program is run. This, however, has some drawbacks specifically with control shadows. You can also try to develop your program as WPF instead of Windows Forms. WPF has much greater control over the transparency of the main form.
Was This Post Helpful? 0
  • +
  • -

#3 Bluezap  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 328
  • Joined: 19-January 12

Re: Transparent form, but controls visible

Posted 18 February 2012 - 02:20 AM

You could go about this in a more different and easy way.
First off you need to get a software such as Photoshop or Paint.NET
Create a page (any size is fine)then fill the page with the color that you want your form to be.Then drop down the opacity of the canvas to your liking (This depends on how opaque you want your form to be)
After that save it as a .PNG file
Now set the color of your form to any color of your liking (Make sure that the color of the form is DIFFERENT from the color of the opaque image file you created before)
Then Set the transparency key to the EXACT color of your form.
Now in the form properties set the background image to the image file you created.
Now when you debug the program you could see that your form is opaque but your components are 100% opaque.
If you need more help just ask :)
Was This Post Helpful? 0
  • +
  • -

#4 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 205
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: Transparent form, but controls visible

Posted 18 February 2012 - 03:22 AM

a simple way to make your Form transparent without affecting the controls, in the Form load event, just set the BackColor property of the form to any color and set the TransparencyKey property to the same color of the BackColor.

BackColor = Color.Azure
TransparencyKey = Color.Azure

This post has been edited by nK0de: 18 February 2012 - 03:55 AM

Was This Post Helpful? 0
  • +
  • -

#5 deepaka  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-August 12

Re: Transparent form, but controls visible

Posted 23 August 2012 - 12:19 PM

Download code number 19 from the website www.codesorigin.com
code available in vb.net 2008. I have tried this one and it working fine.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1