Skip to content

Change color of border on CheckBox #6679

Answered by MarkusKgit
roxxel asked this question in Q&A
Discussion options

You must be logged in to vote

Just an example (using Fluent Theme):

<Grid>
  <Grid.Styles>
    <Style Selector="CheckBox /template/ Border#NormalRectangle">
      <Setter Property="BorderBrush" Value="Red"/>        
    </Style>
    <Style Selector="CheckBox:pointerover /template/ Border#NormalRectangle">
      <Setter Property="BorderBrush" Value="Green" />
    </Style>
  </Grid.Styles>
  <CheckBox Content="Check me"/>
</Grid>

In addition to :pointerover you might want to also handle :pressed, :disabled, :checked, :checked:pointerover, :checked:pressed and :checked:disabled

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mikhailSokolovskiy
Comment options

@thevortexcloud
Comment options

@VoidPlayz510
Comment options

Answer selected by roxxel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants