Solved

WPF opacity controls

Posted on 2010-09-12
10
585 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
  • 3
  • 2
10 Comments
 
LVL 29

Expert Comment

by:Kumaraswamy R
Comment Utility
0
 

Author Comment

by:kyleboca
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 8

Expert Comment

by:adler77
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now