locked
ListBox Tap or Double Taped will changed Backgroud !!! RRS feed

  • Question

  •  I use ListBox  ,When I tap or double taoed  suddenly the listbox background being to White ,its very ugly how to stop it !

    Friday, March 2, 2012 10:16 AM

Answers

  • Hi Trigged,

    This is expected behavior as that is the default style of a ListBox's focus state so the user knows the ListBox has focus. If you want to change it for your app you can update the style. 

    See Quickstart: Styling controls and Quickstart: Control templates.

    To edit a control's Template in Visual Studio select the control in the designer, right click, and select Edit Template. Look for the "Focused" Visual State and update the ListBoxFocusFillBrush.

    --Rob

    Saturday, March 3, 2012 3:05 AM
    Moderator

All replies

  • Hi Trigged,

    This is expected behavior as that is the default style of a ListBox's focus state so the user knows the ListBox has focus. If you want to change it for your app you can update the style. 

    See Quickstart: Styling controls and Quickstart: Control templates.

    To edit a control's Template in Visual Studio select the control in the designer, right click, and select Edit Template. Look for the "Focused" Visual State and update the ListBoxFocusFillBrush.

    --Rob

    Saturday, March 3, 2012 3:05 AM
    Moderator
  • I know the style and template but you see 

    that is Nomal .But when I tap or double taped 

    you see ...

    And I delete Focused Style

    		<VisualStateGroup x:Name="FocusStates">
    									<VisualState x:Name="Focused"/>
    									<VisualState x:Name="Unfocused"/>
    									<VisualState x:Name="PointerFocused"/>
    								</VisualStateGroup>

    Its still like that 

    Monday, March 5, 2012 1:53 AM
  • Its Ok now ,I edit wrong style

    It should be edit Listbox Style  ,but I  edit  ListBox.ItemContainerStyle

    Thank you very much

    Monday, March 5, 2012 8:32 AM