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

Button reflection and style problems

Closed Thread
 
Thread Tools Display Modes
Old 01-10-2006   #1 (permalink)
Vibor Cipan [MSP - Croatia]
Guest


 

Button reflection and style problems

Hi,

How to make button in my code to have it self reflected and, when i put
mouse over it, i'd like to change it's height to, let's say - 100.

I've tried using styles but i didn't had much luck :-)

Here is my XAML:

<Canvas Height="280" Width="800" HorizontalAlignment="Center"
Name="Canvas1" Background="Transparent" VerticalAlignment="Top"
DockPanel.Dock="Top" >
<!--CETVRTI BUTTON-->

<Button
Name ="btnCetvrti"
Canvas.Left ="606"
Canvas.Top ="53"
Height ="173"
Width ="129"
BorderBrush="#FF538DE5"
VerticalContentAlignment ="Top" >
<StackPanel >
<Image Height ="87" Width ="115" HorizontalAlignment="Left"
VerticalAlignment="Top" Source="/Images/tab_04.jpg"/>
<TextBlock VerticalAlignment ="Top" Margin="0,0,0,25" FontWeight
="Bold" FontSize ="10" TextAlignment="Left" Foreground
="#FF3c62a5">Help and Support</TextBlock>
<Image Height ="32" Width ="32" HorizontalAlignment="Center"
VerticalAlignment="Bottom" Source="/Images/redo_32.gif"/>
</StackPanel>

<Button.Background>
<LinearGradientBrush EndPoint="1,1" StartPoint="0,1" Opacity="1">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0" Color="#FF6297E3" />
<GradientStop Offset="0.075" Color="#FF9DC5F8" />
<GradientStop Offset="0.5" Color="#FFC6DDFD" />
<GradientStop Offset="0.925" Color="#FF9DC5F8" />
<GradientStop Offset="1" Color="#FF6297E3" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Button.Background>

</Button>

</Canvas>

Old 01-10-2006   #2 (permalink)
Robert Lin
Guest


 

RE: Button reflection and style problems

Vibor:
The reason your Mouse over trigger doesn't change the Height property for
you is you have already set the Height property explicitly on the Button
element itself. The value takes precedent then Style/Trigger. If you need
to have a default Height value for the Button, set it in the Style, then your
trigger will work. Something likes below:

<Style TargetType="{x:Type Button}">
<Setter Property="Width" Value="25" />
<Style.Triggers>
<Trigger Property="Button.IsMouseOver" Value="true">
<Setter Property="Width" Value="125"/>
</Trigger>
</Style.Triggers>
</Style>

--Robert Lin

"Vibor Cipan [MSP - Croatia]" wrote:

> Hi,
>
> How to make button in my code to have it self reflected and, when i put
> mouse over it, i'd like to change it's height to, let's say - 100.
>
> I've tried using styles but i didn't had much luck :-)
>
> Here is my XAML:
>
> <Canvas Height="280" Width="800" HorizontalAlignment="Center"
> Name="Canvas1" Background="Transparent" VerticalAlignment="Top"
> DockPanel.Dock="Top" >
> <!--CETVRTI BUTTON-->
>
> <Button
> Name ="btnCetvrti"
> Canvas.Left ="606"
> Canvas.Top ="53"
> Height ="173"
> Width ="129"
> BorderBrush="#FF538DE5"
> VerticalContentAlignment ="Top" >
> <StackPanel >
> <Image Height ="87" Width ="115" HorizontalAlignment="Left"
> VerticalAlignment="Top" Source="/Images/tab_04.jpg"/>
> <TextBlock VerticalAlignment ="Top" Margin="0,0,0,25" FontWeight
> ="Bold" FontSize ="10" TextAlignment="Left" Foreground
> ="#FF3c62a5">Help and Support</TextBlock>
> <Image Height ="32" Width ="32" HorizontalAlignment="Center"
> VerticalAlignment="Bottom" Source="/Images/redo_32.gif"/>
> </StackPanel>
>
> <Button.Background>
> <LinearGradientBrush EndPoint="1,1" StartPoint="0,1" Opacity="1">
> <LinearGradientBrush.GradientStops>
> <GradientStop Offset="0" Color="#FF6297E3" />
> <GradientStop Offset="0.075" Color="#FF9DC5F8" />
> <GradientStop Offset="0.5" Color="#FFC6DDFD" />
> <GradientStop Offset="0.925" Color="#FF9DC5F8" />
> <GradientStop Offset="1" Color="#FF6297E3" />
> </LinearGradientBrush.GradientStops>
> </LinearGradientBrush>
> </Button.Background>
>
> </Button>
>
> </Canvas>
>
>

Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Font Size - XP style vs Vista style John M. Dlugosz Vista General 0 02-24-2008 12:46 AM
Font Size - XP style vs Vista style John M. Dlugosz Vista General 1 02-19-2008 09:57 AM
Changing the drawing style of a button from code ( c++ or c# ) John Dunn Avalon 2 10-23-2006 12:08 PM
Grafik and Style where good but a lot of Problems =?Utf-8?B?QmVubnkzNQ==?= Vista hardware & devices 0 08-14-2006 11:50 AM
Grafik and Style where good but a lot of Problems =?Utf-8?B?QmVubnkzNQ==?= Vista General 0 08-13-2006 06:26 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