473,659 Members | 2,671 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_Valu eChanged(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles numOpacity.Valu eChanged
frmMain.Opacity = Me.numOpacity.V alue
End Sub

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

Thanks!
Jan 17 '06 #1
3 1724
"VB Programmer" <do**@emailme.c om> 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_Valu eChanged(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles numOpacity.Valu eChanged
frmMain.Opacity = Me.numOpacity.V alue
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******** ******@TK2MSFTN GP11.phx.gbl...
"VB Programmer" <do**@emailme.c om> 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_Valu eChanged(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles numOpacity.Valu eChanged
frmMain.Opacity = Me.numOpacity.V alue
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.c om> wrote in message
news:%2******** **********@TK2M SFTNGP11.phx.gb l...
I am doing it from .1 to 1.0.

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:ep******** ******@TK2MSFTN GP11.phx.gbl...
"VB Programmer" <do**@emailme.c om> 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_Valu eChanged(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles numOpacity.Valu eChanged
frmMain.Opacity = Me.numOpacity.V alue
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
1795
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 am using transparent PNGs as background images of elements within the table. The following CSS is used to style two elements within the table: ..arrowLeft { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/core/images/arrow.png',
2
2449
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 before the smooth fading out. It never does it from 0.0 to 0.1, only from 1.0 to 0.99. Anyone seen this before?
6
3715
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 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
1
4486
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 that looks like Adobe Acrobat's which appears to draw outside its bounds. To do this, I am setting the Transparency of the SplachScreen form to its background color and then drawing my screen (which appears to have no background). It looks really...
5
2904
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 src="someimage.jpg" name="myImage" id="myImage"> The alpha(opacity=50 does it in IE and the opacity: 0.50 does it Mozilla.
12
3772
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 (maybe looks like a sheet of green glass) but has elements or graphics on top that I want to be opaque. Perhaps I want the sheet of glass to have writing or other graphics "painted" on the surface. Is there some way to mix varying transparencies...
2
2343
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 have tried with Dim p As Integer Dim Vent As Integer For p = 100 To 0 Step -1 Me.Opacity = p For Vent = 1 To 100000
16
7454
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 System.Text; using System.Windows.Forms;
3
4286
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, it should be a better way to do it in fewer codes, right ? ( set all hover function to the same as form ? )
1
2023
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 black. And after it's opacity becomes one it becoems the normal color (Control). The code is as follows public Form1() { InitializeComponent(); this.Opacity = 0; }
0
8332
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2750
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 we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.