MPIon
Well-known member
I am porting an application with some ListBoxes from Net Framework to Net 7. I want them to work exactly as they did before, but there is a dotted box at the top of the listbox that was not there in Net Framework and when clicking in the list box.
The listbox is really just a reference list that I don't want to be selectable or highlighted - I could set it to disabled, but then the text is greyed out.
I think this may be something to do with Visual Styles which may have changed at some point. On researching this, I have seen some code along the lines of :-
However, I cannot fathom where this should be put - something about creating a ItemContainerStyle, but no documentation I can find explains exactly how you do that.
Must be missing a lot of knowledge here.
I am sure it must be simple, so can anyone shed some light on this please.
The listbox is really just a reference list that I don't want to be selectable or highlighted - I could set it to disabled, but then the text is greyed out.
I think this may be something to do with Visual Styles which may have changed at some point. On researching this, I have seen some code along the lines of :-
C#:
<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
However, I cannot fathom where this should be put - something about creating a ItemContainerStyle, but no documentation I can find explains exactly how you do that.
Must be missing a lot of knowledge here.
I am sure it must be simple, so can anyone shed some light on this please.