473,785 Members | 2,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opacity Property

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
Nov 20 '05 #1
6 3721
"Robert A. Boudra" <rb*****@comcas t.net> wrote...
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
Nov 20 '05 #2
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.Compone ntModel.Win32Ex ception'
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

"Tom Leylan" <ge*@iamtiredof spam.com> wrote in message
news:O7******** ******@TK2MSFTN GP09.phx.gbl...
"Robert A. Boudra" <rb*****@comcas t.net> wrote...
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

Nov 20 '05 #3
If Me.Opacity > 0.05 Then

Me.Opacity -= 0.05

End If


This works for me and doesn't give any errors after dragging the form and
re-clicking the button.
Nov 20 '05 #4
* "Robert A. Boudra" <rb*****@comcas t.net> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
>>Maybe you need to update your graphics card drivers.<<

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

Bob

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bq******** *****@ID-208219.news.uni-berlin.de...
* "Robert A. Boudra" <rb*****@comcas t.net> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #6
* "Robert A. Boudra" <rb*****@comcas t.net> scripsit:
Maybe you need to update your graphics card drivers.<<


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


Sometimes even random thoughts help.

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7

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

Similar topics

14
5782
by: DU | last post by:
According to a recent post, it seems that Konqueror 3.1+ and Safari 1.1 support CSS3 opacity style property under a proprietary name: "Support for the CSS3 opacity (using -khtml-opacity) property. Make entire blocks and inlines transparent without resorting to transparent PNGs." http://weblogs.mozillazine.org/hyatt/archives/2003_10.html#004249 Now, I have a demo page which works for MSIE 6 for Windows and Mozilla-based browsers but...
3
10231
by: Marek Mänd | last post by:
This posting will express my concern about the future of css3 forthcoming recommendation. I think for long time now, that the current implementation of CSS attribute opacity is less than usable in practical real life situations. The soon forthcoming CSS3 recommendation does not serve the public interests in this area not at all. The problem relies in the definition what opacity is, how it is to applied to page elements. In past 5...
1
1397
by: Juleke | last post by:
Hello, When I'm using the opacity property for showing a form I can see my application on the computer. But If I'm connecting to this machine via Remote Access (VNC). I see nothing of my application on my remote screen (just the app on the taskbar). Somebody have an idea ?
2
2360
by: Eric Lindsay | last post by:
Can someone point me to a good explanation of how to use opacity? From CSS 3 http://www.w3.org/TR/2003/CR-css3-color-20030514/#opacity which I read to mean just set a decimal value between 0 and 1 I tried using opacity: 0.50; and it appeared to work as expected in Safari and Firefox, but not in Opera. Does it actually work in any version of IE? Does it degrade harmlessly like in Opera? I also noticed the use of filter:...
12
3783
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
2348
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
6
1924
by: Prisoner at War | last post by:
Okay, no such thing, apparently, in the DOM.... How am I supposed to tell JavaScript "turn the whole page opaque"? Is there a "JavaScript/CSS dictionary" and a "JavaScript/CSS grammar" about?? I've looked at several books but so far they're not exactly "rulebooks," which is what I'd need...I need a rulebook that helps me parse English into JavaScript/CSS....
1
1904
by: Keith Hughitt | last post by:
A little off-topic, but, does anyone know if it's possible to set the opacity of jpeg images in IE7+? For firefox, the css "opacity" property works fine on most image types including jpegs. On IE, however, the equivalent filter, "(filter: alpha(opacity=...)," only works with PNG images. Anyone know if it's possible to get the property to work for jpeg images as well? Thanks,
15
3728
by: Sunny | last post by:
Hi, I can change the lement opacity in IE using. abc.style.filter = 'alpha(opacity=' + 10 + ')'; But this dont work in firefox, In firefox it throws error. How I can change the opacity of an element in Firefox.
0
9480
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
10330
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
10153
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
10093
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6740
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
5381
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...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
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
3654
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.