Click here to Skip to main content
15,886,794 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: datagrid multiple selected items Pin
Mycroft Holmes17-Aug-17 21:02
professionalMycroft Holmes17-Aug-17 21:02 
QuestionComboBox Items Not Showing Up Pin
Kevin Marois7-Aug-17 5:28
professionalKevin Marois7-Aug-17 5:28 
AnswerRe: ComboBox Items Not Showing Up Pin
Mycroft Holmes7-Aug-17 15:22
professionalMycroft Holmes7-Aug-17 15:22 
GeneralRe: ComboBox Items Not Showing Up Pin
Kevin Marois8-Aug-17 4:51
professionalKevin Marois8-Aug-17 4:51 
GeneralRe: ComboBox Items Not Showing Up Pin
Kevin Marois8-Aug-17 5:33
professionalKevin Marois8-Aug-17 5:33 
GeneralRe: ComboBox Items Not Showing Up Pin
Mycroft Holmes8-Aug-17 13:57
professionalMycroft Holmes8-Aug-17 13:57 
QuestionListBox Style Problem Pin
Kevin Marois27-Jul-17 6:53
professionalKevin Marois27-Jul-17 6:53 
AnswerRe: ListBox Style Problem Pin
Henrik Jonsson7-Aug-17 9:35
Henrik Jonsson7-Aug-17 9:35 
Hello,

the problem is that the default control template for ListBoxItem contains a border element which controls the background color. To fully control the appearance you could replace the template using the template from ListBoxItem ControlTemplate Example[^] with your own definition. See below for an example.

XML
<Style x:Key="listBoxItemContainerStyle" TargetType="{x:Type ListBoxItem}">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBoxItem">
                        <Border Name="Border" Padding="2" SnapsToDevicePixels="true">
                            <ContentPresenter />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="Orange"/>
                                <Setter Property="Foreground" Value="Blue"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="Gray"/>
                                <Setter TargetName="Border" Property="BorderThickness" Value="2"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="Orange"/>
                                <Setter Property="Foreground" Value="Blue"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

QuestionStyle Not being Applied Pin
Kevin Marois24-Jul-17 7:43
professionalKevin Marois24-Jul-17 7:43 
AnswerRe: Style Not being Applied Pin
Richard Deeming24-Jul-17 7:54
mveRichard Deeming24-Jul-17 7:54 
GeneralRe: Style Not being Applied Pin
Kevin Marois24-Jul-17 10:17
professionalKevin Marois24-Jul-17 10:17 
GeneralRe: Style Not being Applied Pin
Richard Deeming25-Jul-17 0:37
mveRichard Deeming25-Jul-17 0:37 
GeneralRe: Style Not being Applied Pin
Kevin Marois25-Jul-17 4:36
professionalKevin Marois25-Jul-17 4:36 
QuestionHandle DataGrid Row Model Property Change Pin
Kevin Marois21-Jun-17 12:45
professionalKevin Marois21-Jun-17 12:45 
AnswerRe: Handle DataGrid Row Model Property Change Pin
Mycroft Holmes21-Jun-17 20:54
professionalMycroft Holmes21-Jun-17 20:54 
AnswerRe: Handle DataGrid Row Model Property Change Pin
Pete O'Hanlon21-Jun-17 21:46
mvePete O'Hanlon21-Jun-17 21:46 
GeneralRe: Handle DataGrid Row Model Property Change Pin
Kevin Marois22-Jun-17 4:01
professionalKevin Marois22-Jun-17 4:01 
GeneralRe: Handle DataGrid Row Model Property Change Pin
Pete O'Hanlon22-Jun-17 5:03
mvePete O'Hanlon22-Jun-17 5:03 
GeneralRe: Handle DataGrid Row Model Property Change Pin
Mycroft Holmes22-Jun-17 14:41
professionalMycroft Holmes22-Jun-17 14:41 
GeneralRe: Handle DataGrid Row Model Property Change Pin
Pete O'Hanlon22-Jun-17 21:18
mvePete O'Hanlon22-Jun-17 21:18 
GeneralStop user from killing of a running wpf application from background processes in task manager. Pin
Naushad Ansari15-Jun-17 23:24
Naushad Ansari15-Jun-17 23:24 
GeneralRe: Stop user from killing of a running wpf application from background processes in task manager. Pin
Pete O'Hanlon15-Jun-17 23:46
mvePete O'Hanlon15-Jun-17 23:46 
QuestionBind To DP On Control Pin
Kevin Marois15-Jun-17 5:26
professionalKevin Marois15-Jun-17 5:26 
AnswerRe: Bind To DP On Control Pin
Pete O'Hanlon15-Jun-17 6:35
mvePete O'Hanlon15-Jun-17 6:35 
GeneralRe: Bind To DP On Control Pin
Kevin Marois15-Jun-17 6:39
professionalKevin Marois15-Jun-17 6:39 

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

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