Home All Groups Group Topic Archive Search About

How to set opacity of form

Author
17 Jan 2006 7:58 PM
VB Programmer
I have a form which has an opacity control of type numbericupdown.  It's
supposed to control the opacity of frmMain.  Here's my code...

    Private Sub numOpacity_ValueChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles numOpacity.ValueChanged
        frmMain.Opacity = Me.numOpacity.Value
    End Sub

This doesn't seem to work at all.  Any suggestions?

Thanks!

Author
17 Jan 2006 8:08 PM
Herfried K. Wagner [MVP]
"VB Programmer" <d***@emailme.com> schrieb:
>I have a form which has an opacity control of type numbericupdown.  It's
>supposed to control the opacity of frmMain.  Here's my code...
>
>    Private Sub numOpacity_ValueChanged(ByVal sender As System.Object,
> ByVal e As System.EventArgs) Handles numOpacity.ValueChanged
>        frmMain.Opacity = Me.numOpacity.Value
>    End Sub
>
> This doesn't seem to work at all.  Any suggestions?

'Opacity' expects a value between 0 and 1.  Maybe scaling the selected value
to this interval solves the problem.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
17 Jan 2006 8:31 PM
VB Programmer
I am doing it from .1 to 1.0.

Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:epOIKH6GGHA.1452@TK2MSFTNGP11.phx.gbl...
> "VB Programmer" <d***@emailme.com> schrieb:
>>I have a form which has an opacity control of type numbericupdown.  It's
>>supposed to control the opacity of frmMain.  Here's my code...
>>
>>    Private Sub numOpacity_ValueChanged(ByVal sender As System.Object,
>> ByVal e As System.EventArgs) Handles numOpacity.ValueChanged
>>        frmMain.Opacity = Me.numOpacity.Value
>>    End Sub
>>
>> This doesn't seem to work at all.  Any suggestions?
>
> 'Opacity' expects a value between 0 and 1.  Maybe scaling the selected
> value to this interval solves the problem.
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://classicvb.org/petition/>
Author
18 Jan 2006 12:38 AM
Rocky
Set Decimal places to 1. Set Increment to 0.1 Set Minimum Value to 0.1 and
Maximum value to 1.0. Set Value to 1.

Show quoteHide quote
"VB Programmer" <d***@emailme.com> wrote in message
news:%23U%237NU6GGHA.1396@TK2MSFTNGP11.phx.gbl...
>I am doing it from .1 to 1.0.
>
> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
> news:epOIKH6GGHA.1452@TK2MSFTNGP11.phx.gbl...
>> "VB Programmer" <d***@emailme.com> schrieb:
>>>I have a form which has an opacity control of type numbericupdown.  It's
>>>supposed to control the opacity of frmMain.  Here's my code...
>>>
>>>    Private Sub numOpacity_ValueChanged(ByVal sender As System.Object,
>>> ByVal e As System.EventArgs) Handles numOpacity.ValueChanged
>>>        frmMain.Opacity = Me.numOpacity.Value
>>>    End Sub
>>>
>>> This doesn't seem to work at all.  Any suggestions?
>>
>> 'Opacity' expects a value between 0 and 1.  Maybe scaling the selected
>> value to this interval solves the problem.
>>
>> --
>> M S   Herfried K. Wagner
>> M V P  <URL:http://dotnet.mvps.org/>
>> V B   <URL:http://classicvb.org/petition/>
>
>