Click here to Skip to main content
14,766,373 members
Home » Discussions » Silverlight / WPF
   

Silverlight / WPF

 
GeneralRe: Shape Designer Pin
Gerry Schmitz24-Aug-17 7:35
mveGerry Schmitz24-Aug-17 7:35 
GeneralRe: Shape Designer Pin
Kevin Marois24-Aug-17 7:42
professionalKevin Marois24-Aug-17 7:42 
GeneralRe: Shape Designer Pin
Kevin Marois24-Aug-17 13:37
professionalKevin Marois24-Aug-17 13:37 
GeneralRe: Shape Designer Pin
Gerry Schmitz9-Sep-17 14:17
mveGerry Schmitz9-Sep-17 14:17 
AnswerRe: Shape Designer Pin
Pete O'Hanlon24-Aug-17 23:07
mvePete O'Hanlon24-Aug-17 23:07 
Questiondatagrid multiple selected items Pin
Member 1328589317-Aug-17 0:15
MemberMember 1328589317-Aug-17 0:15 
AnswerRe: datagrid multiple selected items Pin
Pete O'Hanlon17-Aug-17 1:43
mvePete O'Hanlon17-Aug-17 1:43 
GeneralRe: datagrid multiple selected items Pin
Member 1328589317-Aug-17 19:50
MemberMember 1328589317-Aug-17 19:50 
AnswerRe: datagrid multiple selected items Pin
Mycroft Holmes17-Aug-17 22:02
professionalMycroft Holmes17-Aug-17 22:02 
QuestionComboBox Items Not Showing Up Pin
Kevin Marois7-Aug-17 6:28
professionalKevin Marois7-Aug-17 6:28 
AnswerRe: ComboBox Items Not Showing Up Pin
Mycroft Holmes7-Aug-17 16:22
professionalMycroft Holmes7-Aug-17 16:22 
GeneralRe: ComboBox Items Not Showing Up Pin
Kevin Marois8-Aug-17 5:51
professionalKevin Marois8-Aug-17 5:51 
GeneralRe: ComboBox Items Not Showing Up Pin
Kevin Marois8-Aug-17 6:33
professionalKevin Marois8-Aug-17 6:33 
GeneralRe: ComboBox Items Not Showing Up Pin
Mycroft Holmes8-Aug-17 14:57
professionalMycroft Holmes8-Aug-17 14:57 
QuestionListBox Style Problem Pin
Kevin Marois27-Jul-17 7:53
professionalKevin Marois27-Jul-17 7:53 
I have created a style for a listbox:

ItemContainerStyle
<Style x:Key="listBoxItemContainerStyle"
        TargetType="ListBoxItem">

<pre>
<Setter Property="Padding" Value="2"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="Black"/>

<Style.Triggers>

    <Trigger Property="IsSelected" Value="True">
        <Setter Property="Background" Value="Orange"/>
        <Setter Property="Foreground" Value="Blue"/>
    </Trigger>

    <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="Background" Value="Orange"/>
        <Setter Property="Foreground" Value="Blue"/>
    </Trigger>

</Style.Triggers>



ListBoxStyle
<Style x:Key="listBoxStyle"
        TargetType="ListBox">

<pre>
<Setter Property="Foreground" Value="Red"/>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBackgroundBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ItemContainerStyle" Value="{StaticResource listBoxItemContainerStyle}"/>

<Style.Triggers>

    <Trigger Property="IsEnabled" Value="False">
        <Setter Property="BorderBrush" Value="{StaticResource ButtonDisabledBackgroundBrush}"/>
        <Setter Property="Control.BorderThickness" Value="2"/>
    </Trigger>

    <Trigger Property="IsKeyboardFocusWithin" Value="True">
        <Setter Property="IsSelected" Value="True"/>
    </Trigger>

</Style.Triggers>



Usage
<ListBox Grid.Row="1"
            Grid.Column="4"
            Style="{StaticResource listBoxStyle}">

<pre>
<ListBoxItem Content="One" IsSelected="True"/>
<ListBoxItem Content="Two" IsEnabled="False"/>
<ListBoxItem Content="333333"/>




When I run it BEFORE I click an item, the background of the first item is lightgray. Notice that the first item has IsSeledted= true.

If I click on it, then the background color turns Blue.

What's wrong here?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: ListBox Style Problem Pin
Henrik Jonsson7-Aug-17 10:35
MemberHenrik Jonsson7-Aug-17 10:35 
QuestionStyle Not being Applied Pin
Kevin Marois24-Jul-17 8:43
professionalKevin Marois24-Jul-17 8:43 
AnswerRe: Style Not being Applied Pin
Richard Deeming24-Jul-17 8:54
mveRichard Deeming24-Jul-17 8:54 
GeneralRe: Style Not being Applied Pin
Kevin Marois24-Jul-17 11:17
professionalKevin Marois24-Jul-17 11:17 
GeneralRe: Style Not being Applied Pin
Richard Deeming25-Jul-17 1:37
mveRichard Deeming25-Jul-17 1:37 
GeneralRe: Style Not being Applied Pin
Kevin Marois25-Jul-17 5:36
professionalKevin Marois25-Jul-17 5:36 
QuestionHandle DataGrid Row Model Property Change Pin
Kevin Marois21-Jun-17 13:45
professionalKevin Marois21-Jun-17 13:45 
AnswerRe: Handle DataGrid Row Model Property Change Pin
Mycroft Holmes21-Jun-17 21:54
professionalMycroft Holmes21-Jun-17 21:54 
AnswerRe: Handle DataGrid Row Model Property Change Pin
Pete O'Hanlon21-Jun-17 22:46
mvePete O'Hanlon21-Jun-17 22:46 
GeneralRe: Handle DataGrid Row Model Property Change Pin
Kevin Marois22-Jun-17 5:01
professionalKevin Marois22-Jun-17 5:01 

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.