473,506 Members | 17,176 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to set opacity of form

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!
Jan 17 '06 #1
3 1719
"VB Programmer" <do**@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/>

Jan 17 '06 #2
I am doing it from .1 to 1.0.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl...
"VB Programmer" <do**@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/>

Jan 17 '06 #3
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.

"VB Programmer" <do**@emailme.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
I am doing it from .1 to 1.0.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl...
"VB Programmer" <do**@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/>


Jan 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1785
by: chris | last post by:
I've used JavaScript DOM scripting to create a table element and alter its opacity. Bizarrely, the contents of the table appear to vanish when the opacity changes. One important note is that I...
2
2439
by: Adam | last post by:
Hi everyone, I have a simple timer which decreases the Opacity from 1.0 to 0.0 and back again. The problem I have is, when it changes from 1.0 to 0.99, the whole form flickers completely...
6
3711
by: Robert A. Boudra | last post by:
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...
1
4470
by: Brian | last post by:
If your like me, you have probably seen way too many demos of the opacity property of a form. Well I finally have a need for it and I am having an issue. I am trying to create a splash screen...
5
2890
by: Webmaster | last post by:
The following style sets the opacity or semi-transparency in Mozilla and Explorer browsers for an image: #myImage{ filter: alpha(opacity=50); -moz-opacity:0.50; opacity: 0.50; } <img...
12
3754
by: Patrick Dugan | last post by:
I know that I can change the opacity of an entire form, but is there a way to control opacity to specific controls or components? For example I want to create a form that is semi-transparent...
2
2336
by: reidarT | last post by:
I want a windows form to act like the one in Outlook when you get a new message and it is visible for about a couple of seconds and then the opacity decreases and the form dissapears in the end I...
16
7432
Atran
by: Atran | last post by:
Hello EveryBody, I write this code but the code not work: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using...
3
4274
by: Boki | last post by:
Hi All, I saw the paint.net program, when mouse hover, the color palette become 100% opacity. I try the code below, the issue is I also have some other controls ( textbox/button ) in my form,...
1
2007
by: akshaycjoshi | last post by:
I am ShowDialoging one form in which the activate event increases the opacity from 0 to 1. I set the opacity to 0 in it's constructor.The problem is that during the showing of the form it becomes...
0
7218
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
7370
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
7021
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
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5614
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,...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1532
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 ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
409
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.