![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| 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 | |||