WPF: Disable ListBox, but enable scrolling

前端 未结 12 2249
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-05 05:33

Been banging my head against this all morning.

Basically, I have a listbox, and I want to keep people from changing the selection during a long running process, but

12条回答
  •  自闭症患者
    2021-01-05 06:10

    If you look in to the control template of the ListBox, there is a ScrollBar and ItemsPresenter inside. So Make the ItemsPresenter Disabled and you will get this easily. Use the bellow Style on the ListBox and you are good to go.

        
    

    On the ListBox use the Style

    
    

提交回复
热议问题