VB和WPF中的组合框 [英] Combo Box in VB and WPF

查看:120
本文介绍了VB和WPF中的组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我有一个快速的问题.我想知道是否有可能以WPF形式使用组合框,该组合框可用于更改我具有的网格背景的颜色.因此,例如,如果我从组合框列表中选择了黄色",则表单内的网格会将颜色更改为黄色.我只需要一个代码段,因为然后可以使用blend找出我要使用的不同颜色.

谢谢

Hello

I have a quick question. I was wondering is it possible to use a combo box in a WPF form that can be used to change the colour of the grid backgrounds that I have. So for example, if I selected "Yellow" off the combo box list, the grids within the form will change colours to yellow. I just need a code snippet because I can then use blend to figure out the different colours I would like to use.

Thank you

推荐答案

使用System.Drawing.KnownColor.在SelectedItemChange/SlectionChange事件中,将网格的颜色设置为选定的值.
Use System.Drawing.KnownColor. In the SelectedItemChange/SlectionChange event set the color of the grid to the selected value.


这篇关于VB和WPF中的组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆