Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

WPF opacity controls

Posted on 2010-09-12
10
Medium Priority
?
654 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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 Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

610 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