![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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> |
| | #2 (permalink) |
| 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> > > |
| |
| |
![]() |
| 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 |