在wpf中的Combobox中的滚动条 [英] Scrollbar in a Combobox in wpf

查看:1035
本文介绍了在wpf中的Combobox中的滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<ComboBox Name="cmbDepartment" Height="25" Width="200" HorizontalAlignment="Left"  Margin="82,34,71,0"   >
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <CheckBox Content="{Binding DepartmentName}" IsChecked="{Binding IsChecked,Mode=TwoWay}" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>




<pre lang="c#"><pre lang="c#">

推荐答案

这个人试试这个 https://www.google.co.in/#sclient=psy-ab&q=scroll+bar+in+combobox+in+wpf&oq =滚动+酒吧+在+ +组合框在+ WPF&安培; gs_l = hp.3 ... 666132.678306.4.678559.31.27.0.0.0.0.0.0..0.0 ... 0.0 ... 1c.1.18.psy-AB。 WMYHETak19M& pbx = 1& bav = on.2,or.r_qf。& bvm = bv.48340889,d.dGI& fp = e4938e8f3f279a9e& biw = 1024& bih = 605 [ ^ ]
this one have try this https://www.google.co.in/#sclient=psy-ab&q=scroll+bar+in+combobox+in+wpf&oq=scroll+bar+in+combobox+in+wpf&gs_l=hp.3...666132.678306.4.678559.31.27.0.0.0.0.0.0..0.0...0.0...1c.1.18.psy-ab.WMYHETak19M&pbx=1&bav=on.2,or.r_qf.&bvm=bv.48340889,d.dGI&fp=e4938e8f3f279a9e&biw=1024&bih=605[^]


你只需要将ScrollViewer Visibility属性添加到true

像这样:



You need to just add ScrollViewer Visibility property to true
Like this :

<ComboBox Name="cmbDepartment" Height="25" Width="200" HorizontalAlignment="Left"  Margin="82,34,71,0" ScrollViewer.VerticalScrollBarVisibility="Visible">
           <ComboBox.ItemTemplate>
               <DataTemplate>
                   <CheckBox Content="{Binding DepartmentName}" IsChecked="{Binding IsChecked,Mode=TwoWay}" />
               </DataTemplate>
           </ComboBox.ItemTemplate>
       </ComboBox>


这篇关于在wpf中的Combobox中的滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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