12
返回列表 发新帖
作者: yyxf
查看: 6259|回复: 11
打印 上一主题 下一主题

[求助] datagridview二维表头,滚动后字糊了

[复制链接]
板凳
 楼主| yyxf 发表于 2015-7-14 19:31:07 | 只看该作者

public partial class RowMergeView : DataGridView
    {
        #region 构造函数
        public RowMergeView()
        {
            InitializeComponent();
            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            //this.SetStyle(ControlStyles.StandardDoubleClick, false);
            this.SetStyle(ControlStyles.Selectable, true);
            this.UpdateStyles();
        }

是这样吗?我试了一下,好像还是一样的
沙发
乔克斯 发表于 2015-7-14 14:21:56 | 只看该作者
@xiaobo
这个控件的无参构造函数中试试加入双缓冲代码。
[C#] 纯文本查看 复制代码
            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            //this.SetStyle(ControlStyles.StandardDoubleClick, false);
            this.SetStyle(ControlStyles.Selectable, true);
            this.UpdateStyles();
您需要登录后才可以回帖 登录 | 加入CSkin博客

本版积分规则

QQ|申请友链|小黑屋|手机版|Archiver|CSkin ( 粤ICP备13070794号

Powered by Discuz! X3.2  © 2001-2013 Comsenz Inc.  Designed by ARTERY.cn
GMT+8, 2024-5-28 21:05, Processed in 0.539203 second(s), 24 queries , Gzip On.

快速回复 返回顶部 返回列表