Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Button reflection and style problems

 
 
Old 01-10-2006   #1 (permalink)
Vibor Cipan [MSP - Croatia]


 
 

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>


My System SpecsSystem Spec
Old 01-10-2006   #2 (permalink)
Robert Lin


 
 

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

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Font Size - XP style vs Vista style Vista General
Font Size - XP style vs Vista style Vista General
Grafik and Style where good but a lot of Problems Vista hardware & devices
Grafik and Style where good but a lot of Problems Vista General


Vista Forums 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 Ltd

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