Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. ComboBox Style Border Brush

ComboBox Style Border Brush

Scheduled Pinned Locked Moved WPF
csswpfwcfquestion
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    I can't get the BorderBrush and BorderThickness of my ComboBoxStyle to work. Changes I make don't appear. If I change the BorderBrush to "Red", it still remains Gray. Anyone see what I'm doing wrong?

        <Setter Property="Height" Value="28"/>
        <Setter Property="UIElement.SnapsToDevicePixels" Value="True"/>
        <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
        <Setter Property="TextElement.Foreground" Value="Black"/>
        <Setter Property="BorderBrush" Value="Gray"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    
                    <Grid>
                        
                        <ToggleButton Name="ToggleButton" 
                                      Grid.Column="2"
                                      ClickMode="Press" 
                                      Focusable="False"
                                      IsChecked="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                      Template="{StaticResource ComboBoxToggleButtonTemplate}"/>
    
                        <ContentPresenter Name="ContentSite" 
                                          Margin="5, 3, 23, 3" 
                                          IsHitTestVisible="False"
                                          HorizontalAlignment="Left" 
                                          VerticalAlignment="Center"                              
                                          Content="{TemplateBinding ComboBox.SelectionBoxItem}" 
                                          ContentTemplate="{TemplateBinding ComboBox.SelectionBoxItemTemplate}"
                                          ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
                        
                        <TextBox Name="PART\_EditableTextBox" 
                                 Margin="3, 3, 0, 3"
                                 IsReadOnly="{TemplateBinding IsReadOnly}"
                                 Visibility="Hidden</x-turndown>
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups