-4

I am creating a comboBox in c# to handle a list. Please look into the picture.

my picture

What I want is to make the selectedItem not to display after I select any item.

The desired outcome will be like this: expected output. Furthermore, if can make it to display like a button, that will be better.

Any idea how to do so?

Simple example: V is the toggleButton

Original:

selectedItem | V
 item1
 item2
 item3

What I want:

V
 item1
 item2
 item3
Jack Lee
  • 3
  • 3

1 Answers1

0

You will need to edit a ControlTemplate for your ComboBox and reference it either directly or throught style for your ComboBox:

https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/combobox-styles-and-templates?view=netframeworkdesktop-4.8

You can remove the ContentPreseter named ContentSite, and all refernces to it in triggers and storyboards.

In the ComboBoxItem you will have to remove triggers/storyboard that work when its IsSelected is true.

o_w
  • 581
  • 3
  • 12