2013年1月25日金曜日

WPFのListBoxで選択項目のハイライトを無効にする方法


WPFのListBoxで選択項目のハイライトを無効にする方法。

Style style = new Style(typeof(ListBoxItem));
SolidColorBrush brush = new SolidColorBrush(Colors.Transparent);
style.Resources.Add(SystemColors.HighlightBrushKey, brush);
style.Resources.Add(SystemColors.InactiveSelectionHighlightBrushKey, brush);
listBox.ItemContainerStyle = style;
view raw gistfile1.cs hosted with ❤ by GitHub

0 件のコメント:

コメントを投稿