开发者

WPF how to highlight and select an item in code in comobox

开发者 https://www.devze.com 2022-12-12 14:28 出处:网络
Hi all i need help wih my combobox. Iam quite new in the WPF world. Ihave an combobox that the itemsource is binding with the following items:

Hi all i need help wih my combobox. Iam quite new in the WPF world. Ihave an combobox that the itemsource is binding with the following items:

Red
Green
Blue
Yellow

I want to select like "Red" in the code behind then the combobox will highligt "Red" and开发者_高级运维 "Red" is selected. How can i do this in code thanks for advice. And sorry for my bad english.


You can bind combobox's value property to description, and the item will be highligted after setting value

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号