Aaron
Aaron

Reputation: 1989

How To Make VB.Net Form Invisible

I am using VB.Net and I'd like to ask how could I make my form invisible while the other objects on it are visible? When I set the form's opacity property into 0%, the objects on it are affected. Thanks in advance :))

Upvotes: 1

Views: 1110

Answers (2)

talha2k
talha2k

Reputation: 1

You can use the TransparencyKey Property of the form. You can set the forms back color, then set that as the transparency key and only the back color will become transparent. It will make the form transparent except the controls.

Like this:

Public Sub InitializeMyForm()
    BackColor = Color.Red
    ' Make the background color of form display transparently.
    TransparencyKey = BackColor
End Sub 'InitializeMyForm

Hope this helps.

Upvotes: 2

Ash Burlaczenko
Ash Burlaczenko

Reputation: 25455

There's no simple way to do this but theres many examples on the internet showing how it could be do.

Try this method http://www.vbforums.com/showthread.php?t=396385

Upvotes: 0

Related Questions