?
Solved

WPF opacity controls

Posted on 2010-09-12
10
Medium Priority
?
622 Views
Last Modified: 2013-12-17
I have a WPF form with a jpeg on a canvas. I then adjusted the opacity controls to fade it out to look more like a water mark. Then on top of that I have some labels that I want to be fully bold on top of the watermark looking jpeg.

A setting got changed some how. Now when I move the labels with the mouse in VS2010 they go opaque instantly and are barely visible. However if I move them with the arrows on my keyboard they stay bold.

Thanks in advance for your help.
0
Comment
Question by:kyleboca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
10 Comments
 

Author Comment

by:kyleboca
ID: 33660944
Any explanation why they look fine until I try to move them with a mouse in the design environment? If I move them with the key board arrows they stay bold.

Must this be done in XAML? Are there any settings in the property window for the labels to handle this?
0
 

Author Comment

by:kyleboca
ID: 33711121
I tried setting the opacity to 1 in the XAML code for the labels and they are still very faded. And like I said before the labels that are not faded can't be moved or the turn faded.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 8

Expert Comment

by:adler77
ID: 33727846
The visual editors (both Blend and VS2010) may sometimes move elements into a different panel if you drag over it. For instance, if you have elements to the left, and a panel (Grid, Border, etc.) to the right, if you drag the elements to the right it may drop them "inside" that panel (even if you just meant to place them over the panel). In that case, they will take on the properties of said panel, like Opacity. You can either use the mouse, like you said, or adjust the Margin or Canvas.Top/Canvas.Left (depending on what panel you are using) in XAML or the property inspector. Let me know if this makes sense...
0
 

Author Comment

by:kyleboca
ID: 33728609
Yes it makes sense but there is no other panel or border just a canvas over the entire form with labels on the canvas.

My dilemma is that I don't have a lot of time on this project to stop and learn XAML but I like the visual effects of WPF. I am hoping to make all corrections in the properties window of the controls.

0
 
LVL 8

Accepted Solution

by:
adler77 earned 2000 total points
ID: 33730287
So the Canvas itself has an Opacity of 1, but it is the Image inside of it that has an Opacity less than 1? I can't think of any other reason why this would happen. At any rate, if you look at the XAML itself for the labels there should be two properties: Canvas.Left and Canvas.Top. As long as the labels are directly inside a Canvas, adjusting those will move them to the appropriate place.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question