Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Tooltip ControlTemplate

Closed Thread
 
Thread Tools Display Modes
Old 02-02-2006   #1 (permalink)
Erno
Guest


 

Tooltip ControlTemplate

I decided to do some artistic thingy to my tooltips:

<Style TargetType="{x:Type ToolTip}">
<Setter Property="ToolTip.Background">
<Setter.Value>
<RadialGradientBrush Center="0,0" RadiusX="0.9" RadiusY="0.9"
GradientOrigin="0,0" >
<RadialGradientBrush.GradientStops>
<GradientStop Color="LightBlue" Offset="1" />
<GradientStop Color="White" Offset="0" />
</RadialGradientBrush.GradientStops>
</RadialGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="ToolTip.Template">
<Setter.Value>
<ControlTemplate>
<Grid Background="{TemplateBinding Property=Control.Background}">
<ContentPresenter Content="{TemplateBinding
Property=ContentControl.Content}"
Margin="{TemplateBinding
Property=Control.Padding}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

Lo and behold: a nice gradient to all my tooltips! But... why does the
tooltip still have a shadow? I thought that Control Template replaced all
layout...

Erno


Old 02-02-2006   #2 (permalink)
Erno
Guest


 

Re: Tooltip ControlTemplate

After some experiments:

It is not a shadow! A black rectangular form is reserved as a kind of panel
on which the tiptip is drawn.

Does anybody know how to make that rectangle transparent (or make it go
away)?

Erno

"Erno" <no-spam> wrote in message
news:urZw80zJGHA.2064@TK2MSFTNGP09.phx.gbl...
>I decided to do some artistic thingy to my tooltips:
>
> <Style TargetType="{x:Type ToolTip}">
> <Setter Property="ToolTip.Background">
> <Setter.Value>
> <RadialGradientBrush Center="0,0" RadiusX="0.9" RadiusY="0.9"
> GradientOrigin="0,0" >
> <RadialGradientBrush.GradientStops>
> <GradientStop Color="LightBlue" Offset="1" />
> <GradientStop Color="White" Offset="0" />
> </RadialGradientBrush.GradientStops>
> </RadialGradientBrush>
> </Setter.Value>
> </Setter>
> <Setter Property="ToolTip.Template">
> <Setter.Value>
> <ControlTemplate>
> <Grid Background="{TemplateBinding Property=Control.Background}">
> <ContentPresenter Content="{TemplateBinding
> Property=ContentControl.Content}"
> Margin="{TemplateBinding
> Property=Control.Padding}"/>
> </Grid>
> </ControlTemplate>
> </Setter.Value>
> </Setter>
> </Style>
>
> Lo and behold: a nice gradient to all my tooltips! But... why does the
> tooltip still have a shadow? I thought that Control Template replaced all
> layout...
>
> Erno
>



Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista tooltip Nhat Vista General 4 04-08-2008 10:16 AM
CustomControl and controlTemplate Eager Avalon 3 09-28-2007 02:06 AM
IE7 tooltip bugs Joakim Vista General 2 06-21-2006 08:23 AM
User controls in a ControlTemplate Griff Avalon 1 05-26-2006 04:28 AM
Tooltip customisation Ranj Avalon 0 04-21-2006 10:05 AM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50