Click here to Skip to main content

Silverlight / WPF

   

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
GeneralRe: View Refresh Problem [modified] PinprotectorPete O'Hanlon9:17 21 Feb '12  
GeneralRe: View Refresh Problem PinprotectorAspDotNetDev9:26 21 Feb '12  
GeneralRe: View Refresh Problem PinprotectorPete O'Hanlon9:39 21 Feb '12  
GeneralRe: View Refresh Problem PinmemberKevin Marois13:29 22 Feb '12  
GeneralRe: View Refresh Problem PinprotectorPete O'Hanlon20:07 22 Feb '12  
GeneralRe: View Refresh Problem PinmemberMycroft Holmes13:14 22 Feb '12  
QuestionAccelerator keys on buttons not working PinmemberBernhard Hiller1:13 21 Feb '12  
A short time ago, I started learning WPF (with C#). I learned how to create styles and to embed them.
My style contains
<Style x:Key="RoundedButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
     <Setter Property="Template">
         <Setter.Value>
             <ControlTemplate TargetType="{x:Type Button}">
                 <Grid>
                     <Rectangle Fill="{TemplateBinding Background}" Stroke="Black" RadiusX="8" RadiusY="8"/>
                     <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                 </Grid>
             </ControlTemplate>
         </Setter.Value>
     </Setter>
     <Setter Property="Background"  Value="{StaticResource GreenGradientBrush}"/>
     <Style.Triggers>
         <Trigger Property="Button.IsFocused" Value="true">
             <Setter Property = "Background"   Value="{StaticResource RedGradientBrush}"/>
         </Trigger>
         <Trigger Property="Button.IsMouseOver" Value="true">
             <Setter Property = "Background"   Value="{StaticResource GoldGradientBrush}"/>
         </Trigger>
     </Style.Triggers>
 </Style>
 
 <Style x:Key="AcceptButton" TargetType="{x:Type Button}" BasedOn="{StaticResource RoundedButton}">
     <Setter Property="Background"  Value="{StaticResource BlueGradientBrush}"/>
     <Setter Property="Content" Value="_OK" />
     <Setter Property="IsDefault" Value="true" />
 </Style>
 
When I add the AcceptButton to a Window, the underline of "_OK" shows up, and clicking ALT+O does not have any effect.
How can I get the accelerator key working?
AnswerRe: Accelerator keys on buttons not working PinprotectorPete O'Hanlon1:32 21 Feb '12  
GeneralRe: Accelerator keys on buttons not working PinmemberBernhard Hiller2:38 21 Feb '12  
GeneralRe: Accelerator keys on buttons not working PinprotectorPete O'Hanlon2:43 21 Feb '12  
QuestionData binding to a UserControl PinmemberJohn T.Emmatty6:05 19 Feb '12  
AnswerRe: Data binding to a UserControl PinprotectorPete O'Hanlon2:53 21 Feb '12  
Question901130 - Image is not displayed Pinmemberilostmyid221:59 18 Feb '12  
AnswerRe: 901130 - Image is not displayed Pinmemberilostmyid221:42 20 Feb '12  
AnswerRe: 901130 - Image is not displayed PinprotectorPete O'Hanlon2:49 21 Feb '12  
QuestionResource Dictionary Question PinmemberKevin Marois14:40 17 Feb '12  
AnswerRe: Resource Dictionary Question PinmemberCollin Jasnoch4:44 20 Feb '12  
QuestionBest Design Approach For This App [modified] PinmemberKevin Marois14:46 15 Feb '12  
AnswerRe: Best Design Approach For This App PinmemberSledgeHammer017:32 16 Feb '12  
GeneralRe: Best Design Approach For This App PinmemberKevin Marois7:43 16 Feb '12  
QuestionSet Combo SelectedItem In DataTemplate PinmemberKevin Marois5:30 15 Feb '12  
AnswerRe: Set Combo SelectedItem In DataTemplate PinmemberSledgeHammer018:05 15 Feb '12  
GeneralRe: Set Combo SelectedItem In DataTemplate PinmemberKevin Marois15:48 15 Feb '12  
GeneralRe: Set Combo SelectedItem In DataTemplate PinmemberSledgeHammer017:25 16 Feb '12  
QuestionTrying to use the VisualStateManager PinmemberSuper Lloyd2:04 15 Feb '12  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Beta | 2.5.120517.1 | Last Updated 22 May 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid