Link to home
Start Free TrialLog in
Avatar of kyleboca
kyleboca

asked on

WPF opacity controls

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.
Avatar of Kumaraswamy R
Kumaraswamy R
Flag of India image

Avatar of kyleboca
kyleboca

ASKER

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?
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.
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...
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.

ASKER CERTIFIED SOLUTION
Avatar of adler77
adler77
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial