wpf怎么把checkbox放到combobox里面.. 本帖最后由 lerbornjames 于 2013-10-22 16:43:09 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 类似于这样即可实现了:<ComboBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <CheckBox IsChecked="{Binding IsSelected}" Width="20" /> <TextBlock Text="{Binding DayOfWeek}" Width="100" /> </StackPanel> </DataTemplate></ComboBox.ItemTemplate>http://stackoverflow.com/questions/859227/looking-for-a-wpf-combobox-with-checkboxes/6606691#6606691 效果实现了. 我也是用这种方式的,但是少了一个StackPanel包着,所以就老报错.. 新手不知道这些规则.. 伤不起.. 谢谢了.. 我现在是这样实现的:[code=csharp]<ComboBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <CheckBox Click="xxx" Width="20" > <TextBlock> <Run Text="xxx1"/> <Run Text="xxx2"/> <TextBlock/> </CheckBox> </StackPanel> </DataTemplate></ComboBox.ItemTemplate>[/code]在CheckBox的Click事件拿到的Sender监视的值为:我要怎么才能拿到 "内容" 里面的值呢..? C# Windows窗体应用程序和WPF 的疑问 求解串口线程序传输文件 请教高人 ,c# 操作access C#的winForm中的一个小问题,送分~~ 这句SQL哪错了,请高人指点 想问一下C#里用TCP协议实现一个客户端连接多个服务端怎么做 怎样从.xml文件中读取相对应的记录? 请教将DataTable中保存的表以及数据写入数据库的方法 求一个区分string 和类的对象的方法 寻找asp.net(c#)高手指导 GridView入门级问题 C# DataGridView 中如何使CheckBoxCell和图片一起显示在同一单元格?
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding IsSelected}"
Width="20" />
<TextBlock Text="{Binding DayOfWeek}"
Width="100" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>http://stackoverflow.com/questions/859227/looking-for-a-wpf-combobox-with-checkboxes/6606691#6606691
效果实现了. 我也是用这种方式的,但是少了一个StackPanel包着,所以就老报错..
新手不知道这些规则.. 伤不起.. 谢谢了..
我现在是这样实现的:[code=csharp]<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox Click="xxx"
Width="20" >
<TextBlock>
<Run Text="xxx1"/>
<Run Text="xxx2"/>
<TextBlock/>
</CheckBox>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
[/code]在CheckBox的Click事件拿到的Sender监视的值为:我要怎么才能拿到 "内容" 里面的值呢..?