Live

  博客园 :: 首页 :: 联系 :: 订阅 订阅 :: 管理
  4 Posts :: 1 Stories :: 55 Comments :: 0 Trackbacks
我们的项目用ListView来显示数据,但是客户有一个要求:
第一例内容要靠中央。
但是 ColumnHeader 的TextAlign属性被写成这样:
public HorizontalAlignment TextAlign
{
      
get
      
{
            
if (!this.textAlignInitialized && (this.listview != null))
            
{
                  
this.textAlignInitialized = true;
                  
if ((this.Index != 0&& (this.listview.RightToLeft == RightToLeft.Yes))
                  
{
                        
this.textAlign = HorizontalAlignment.Right;
                  }

            }

            
return this.textAlign;
      }

      
set
      
{
            
this.textAlign = value;
            
if ((this.Index == 0&& (this.textAlign != HorizontalAlignment.Left))
            
{
                  
this.textAlign = HorizontalAlignment.Left;
            }

            
if (this.listview != null)
            
{
                  
this.listview.SetColumnInfo(1this);
                  
this.listview.Invalidate();
            }

      }

}
所以直接设置TextAlign属性是不行的。
继承的话很多成员都是private,重写的话用到的很多类是internal的。
应该怎么来实现?
posted on 2006-03-24 13:43 一唯 阅读(237) 评论(1)  编辑 收藏 网摘 所属分类: 控件&组建

Feedback

改一下结构试试
  回复  引用    




发表评论

昵称: [登录] [注册]

主页:

邮箱:(仅博主可见)

评论内容:

  登录  注册

[使用Ctrl+Enter键快速提交评论]

0 357730




相关文章:

相关链接: