Opacity Property

  • Thread starter Thread starter Robert A. Boudra
  • Start date Start date
R

Robert A. Boudra

As you will probably guess, I'm just starting out with VB.net although I'm a
long time VB developer. I was playing around with the Opacity property of a
form and have found that I can set the property at design time or in code
just fine, but as soon as I move the form to a new location on the screen,
it becomes completely opaque. If I then try to set the opacity property
again, I get an error message. Any idea what's going wrong?

Bob
 
Robert A. Boudra said:
As you will probably guess, I'm just starting out with VB.net although I'm a
long time VB developer. I was playing around with the Opacity property of a
form and have found that I can set the property at design time or in code
just fine, but as soon as I move the form to a new location on the screen,
it becomes completely opaque. If I then try to set the opacity property
again, I get an error message. Any idea what's going wrong?

Hi Bob... I've got a suggestion though :-) You could show the line you are
using to set the opacity and second you could let us know what the error
message is.

If you want to test it more yourself, start a project, add a form, set the
opacity and run the program. If that gives you an error I would be
surprised but if it does you have limited the number of other factors that
may be causing the error.

Does doing nothing more than the following cause the error? What error?

Me.Opacity = .5

Tom
 
Tom:

I have a the following code in a Button Click event of on a form:

If Me.Opacity > 0.05 Then

Me.Opacity -= 0.05

End If

As I click this button the Opacity of the form continues to get smaller
(more transparent). However, if I stop and drag the form to a new location
on the screen, it immediately reverts to completely Opaque. If I then click
the button again I get this message:

"An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.windows.forms.dll
Additional information: The parameter is incorrect"

and execution breaks on the "Me.Opacity -= 0.05" line of code above.

Thanks,

Bob
 
* "Robert A. Boudra said:
As you will probably guess, I'm just starting out with VB.net although I'm a
long time VB developer. I was playing around with the Opacity property of a
form and have found that I can set the property at design time or in code
just fine, but as soon as I move the form to a new location on the screen,
it becomes completely opaque.

This should not occur. Maybe you need to update your graphics card drivers.
If I then try to set the opacity property
again, I get an error message. Any idea what's going wrong?

Text of the error message?
 
Maybe you need to update your graphics card drivers.<<

That was it! I updated my Graphics driver, and now it works fine. Thanks!

Bob
 
* "Robert A. Boudra said:
That was it! I updated my Graphics driver, and now it works fine. Thanks!

Sometimes even random thoughts help.

;-)
 
Back
Top