Solved

WPF opacity controls

Posted on 2010-09-12
10
609 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…

717 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