Do not allow unselect/deselect in ListBox

后端 未结 2 1056
滥情空心
滥情空心 2020-12-11 22:11

Is there a way to configure the WPF ListBox such that it\'s not possible to deselect/unselect an item? So there is always an item selected?

My Lis

2条回答
  •  天涯浪人
    2020-12-11 22:57

    Sound more like a RadioButtonGroup.You can customize the ItemContainerStyle of listbox and easily have this behavior in your listboxes.See below

        
        
            
                
            
        
        
                
            
        
    
    
    
            
                WindowStyle:
                
            
    
    

    Check the below link for more

    http://drwpf.com/blog/2009/05/12/itemscontrol-l-is-for-lookless/

提交回复
热议问题