近日在silverlight中想实现一个在combobox选择字体的效果,结果发现没有这方面现成的字体与值的对照表,特整理了一份,与大家共享
<ComboBox x:Name="cbFontFamily" SelectionChanged="cbFontFamily_SelectionChanged"> <ComboBoxItem Content="Arial" FontFamily="Arial" ></ComboBoxItem> <ComboBoxItem Content="Tahoma" FontFamily="Tahoma" ></ComboBoxItem> <ComboBoxItem Content="仿宋-GB2312" FontFamily="FangSong_GB2312" ></ComboBoxItem> <ComboBoxItem Content="华文黑体" FontFamily="SimHei" ></ComboBoxItem> <ComboBoxItem Content="华文彩云" FontFamily="STCaiyun" ></ComboBoxItem> <ComboBoxItem Content="华文仿宋" FontFamily="STFangsong" ></ComboBoxItem> <ComboBoxItem Content="华文琥珀" FontFamily="STHupo" ></ComboBoxItem> <ComboBoxItem Content="华文隶书" FontFamily="STLiti" ></ComboBoxItem> <ComboBoxItem Content="华文宋体" FontFamily="STSong" ></ComboBoxItem> <ComboBoxItem Content="华文细黑" FontFamily="STXihei" ></ComboBoxItem> <ComboBoxItem Content="华文新魏" FontFamily="STXinwei" ></ComboBoxItem> <ComboBoxItem Content="华文行楷" FontFamily="STXingkai" ></ComboBoxItem> <ComboBoxItem Content="华文中宋" FontFamily="STZhongsong" ></ComboBoxItem> <ComboBoxItem Content="楷体-GB2312" FontFamily="KaiTi_GB2312" ></ComboBoxItem> <ComboBoxItem Content="隶书" FontFamily="LiSu" ></ComboBoxItem> <ComboBoxItem Content="宋体" FontFamily="SimSun" ></ComboBoxItem> <ComboBoxItem Content="微软雅黑" FontFamily="Microsoft YaHei" ></ComboBoxItem> <ComboBoxItem Content="新宋体" FontFamily="NSimSun" ></ComboBoxItem> <ComboBoxItem Content="幼圆" FontFamily="YouYuan" ></ComboBoxItem> <ComboBoxItem Content="Arial Unicode MS" FontFamily="Arial Unicode MS" ></ComboBoxItem> <ComboBoxItem Content="Candara" FontFamily="Candara" ></ComboBoxItem> <ComboBoxItem Content="Symbol" FontFamily="Symbol" ></ComboBoxItem> <ComboBoxItem Content="Verdana" FontFamily="Verdana" ></ComboBoxItem> <ComboBoxItem Content="Latha" FontFamily="Latha" ></ComboBoxItem> </ComboBox>
但目前silverlight2 rc(预备正式版)版本中没有selectValue这个属性,还不知道如何获取Combobox选择的值,也许正式版本就有了吧。。