齐心协力解决问题:如何检查DataGrid中是否出现了垂直滚动条? 齐心协力解决问题:如何检查DataGrid中是否出现了垂直滚动条? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是web的还是winform的帮你UP 呵呵,是winform的,不好意思。多谢你 了。再给指点一下把。 我也没有找到好的方法,不过有一个折衷的方案我是这样做的,先用remotesoft反编译system.windows.form.dll中的DataGrid控件在代码中发现有一个字段private ScrollBar vertScrollBar(对应protected ScrollBar VertScrollBar),当DataGrid重绘的时候它会设置它的visible属性所以using System;using System.Windows.Forms;public class myDataGrid :System.Windows.Forms.DataGrid { protected override void OnPaint(PaintEventArgs pe) { base.OnPaint(pe); if ( this.VertScrollBar.Visible ) { //做你想做的,触发个事件什么的 } } }困了,睡觉了,hope it helps you! youwanna(^o^) 的方法有意思啊 C#泛型,求每句代码的详细解释 关于用csla框架开发分布式系统 在线制作名片各位置参数是如何保存的 如何保证同时更新多个表成功? WinForm怎么控制页面布局 C#操作excel C#中的反射?是怎么一回事? wpf项目中窗口调用close()不能完全退出程序,还停留在debug状态 对接口的讨论 报这很小的希望问一个多服务器下载文件问题。 C#可否不通过调用Word、Excel的COM接口来实现Word、Excel文档内容的抓取? 奇怪的报表问题?
帮你UP
在代码中发现有一个字段private ScrollBar vertScrollBar(对应protected ScrollBar VertScrollBar),当DataGrid重绘的时候它会设置它的visible属性
所以
using System;
using System.Windows.Forms;
public class myDataGrid :System.Windows.Forms.DataGrid
{
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
if ( this.VertScrollBar.Visible )
{
//做你想做的,触发个事件什么的
} }
}
困了,睡觉了,hope it helps you!