changing selected itms color in a listbox

后端 未结 2 1005
暗喜
暗喜 2021-01-25 18:43

i want to change the color of a selected items from a list box control how to do that in windows(Winforms)

2条回答
  •  感情败类
    2021-01-25 19:25

    Assuming you're working with WinForms:

    Most controls will have a BackColor and BorderColor property. You could add the Color objects to your listbox (the color name should be displayed as Color.ToString() returns the name), then use listbox.SelectedItems[0] to get the color and update the other controls' BackColor etc.

提交回复
热议问题