WPF ListView 居中显示

WPF ListView 居中显示
原文: WPF ListView 居中显示

今天遇到的问题:


方法1:设置GridViewColumn的ActualWidth

 
            
                
                    
                        
                            
                                
                            
                        
                    
                    
                        
                            
                                
                                    
                                
                            
                        
                    
                
            
        

注意修改CheckBox居中的时候,需要把他套在Border里,直接写在CheckBox上话没效果。



方法2:设置Style,推荐。

        
再修改需要居中的控件HorizontalAlignment=“Center”


            
                
                    
                        
                            
                                
                            
                        
                    
                    
                        
                            
                                
                            
                        
                    
                    
                        
                            
                                
                            
                        
                    
                
            
        


posted on 2018-08-28 12:04 NET未来之路 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lonelyxmas/p/9547366.html

你可能感兴趣的:(WPF ListView 居中显示)