Making a control "disappear" behind another transparent one....
Making a control "disappear" behind another transparent one....
Making a control "disappear" behind another transparent one....
Making a control "disappear" behind another transparent one....
Making a control "disappear" behind another transparent one....
Making a control "disappear" behind another transparent one.... Making a control "disappear" behind another transparent one.... Making a control "disappear" behind another transparent one.... Making a control "disappear" behind another transparent one.... Making a control "disappear" behind another transparent one.... Making a control "disappear" behind another transparent one.... Making a control "disappear" behind another transparent one.... Making a control "disappear" behind another transparent one....
Making a control "disappear" behind another transparent one.... Making a control "disappear" behind another transparent one....
Making a control "disappear" behind another transparent one....
Go Back  Xtreme Visual Basic Talk > > > Making a control "disappear" behind another transparent one....


Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2011, 12:53 AM
Jellio Jellio is offline
Regular
 
Join Date: Nov 2009
Posts: 56
Default Making a control "disappear" behind another transparent one....


Yeah, I know. Too difficult to explain in the title......

See the attachment below.....

The "This is a test......" text is a label, that is the child of a Canvas. The Canvas is the child of the horizontal StackPanel that also has the blue Canvas with the team records on it as well as the team logo images and the team name labels. The black line is where the Canvas that holds the "This is a test....." label starts.

I wan't the "This is a test....." text to roll from right to left, but the problem is that because all the controls on the StackPanel are transparent, the text doesn't "dissappear" underneath them, even when they leave the area of their parent control. How can I make them do that? ZIndex isn't the answer because my problem is not which control is on top, but instead the fact that the controls "above" it are transparent.

How can I fix this? I'm using WPF
Attached Images
File Type: png xmpl.png (152.7 KB, 9 views)

Last edited by Jellio; 09-17-2011 at 01:21 AM.
Reply With Quote
  #2  
Old 09-17-2011, 06:34 AM
AtmaWeapon's Avatar
AtmaWeaponMaking a control "disappear" behind another transparent one.... AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Transparent means transparent in WPF. If a transparent region overlaps something, you can see the something through the transparency. It was a result of incomplete transparency support that transparent elements could obscure content in WinForms.

For a ham-fisted solution, you could slap extra elements on the side of the parent and give them a background the same as the form. This is silly and likely error-prone.

If I understand right, you're trying to make a scrolling marquee out of the text. I could answer *much* better if I could see some representative XAML in addition to your screenshot, which doesn't illustrate much. I don't think you need a Canvas, but we can talk about that when I've got time to make an example. (My Little Pony season 2 starts today whoooooo! Also I'm going to the auto mechanic when they open in 15 minutes boooooooo!)

If your XAML looks more or less like this:
Code:
<StackPanel>
    ...
    <Canvas>
        <Label>This is a test...</Label>
        ...
    </Canvas>
    ...
</StackPanel>
Try setting the ClipToBounds property of the Canvas to true. If that doesn't work, post some representative XAML and we can talk about alternatives. If we have to go down that road, I want to see enough XAML to understand if all of this is in a DataGrid, a ListView, or whatever.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Making a control &quot;disappear&quot; behind another transparent one....
Making a control &quot;disappear&quot; behind another transparent one....
Making a control &quot;disappear&quot; behind another transparent one.... Making a control &quot;disappear&quot; behind another transparent one....
Making a control &quot;disappear&quot; behind another transparent one....
Making a control &quot;disappear&quot; behind another transparent one....
Making a control &quot;disappear&quot; behind another transparent one.... Making a control &quot;disappear&quot; behind another transparent one.... Making a control &quot;disappear&quot; behind another transparent one.... Making a control &quot;disappear&quot; behind another transparent one.... Making a control &quot;disappear&quot; behind another transparent one.... Making a control &quot;disappear&quot; behind another transparent one.... Making a control &quot;disappear&quot; behind another transparent one....
Making a control &quot;disappear&quot; behind another transparent one....
Making a control &quot;disappear&quot; behind another transparent one....
 
Making a control &quot;disappear&quot; behind another transparent one....
Making a control &quot;disappear&quot; behind another transparent one....
 
-->