社区
C#
帖子详情
求解.net datagridview[i,e.rowindex].tooltiptext 延长显示时间。
会飞的孩纸
2012-03-28 10:27:51
不懂如何设置tooltiptext延长显示时间,求大神帮忙。
...全文
216
5
打赏
收藏
求解.net datagridview[i,e.rowindex].tooltiptext 延长显示时间。
不懂如何设置tooltiptext延长显示时间,求大神帮忙。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
maguzi2008
2012-03-29
打赏
举报
回复
lz是想直接修改datagridview的某个参数达到目的,这可能需要你自己编写一个继承类,应当也可以实现,那样以后就方便了!
会飞的孩纸
2012-03-29
打赏
举报
回复
private void dgvData_RowEnter(object sender, DataGridViewCellEventArgs e)
{
try
{
for (int i = 0; i < dgvData.Rows[e.RowIndex].Cells.Count; i++)
{
StringBuilder sbder = new StringBuilder();
sbder.AppendFormat("行数据基本信息:\r\n\t");
for (int j = 0; j < dgvData.Rows[e.RowIndex].Cells.Count; j++)
{
if (dgvData.Columns[j].Visible)
{
DataGridViewCell cell = dgvData.Rows[e.RowIndex].Cells[j];
if (cell.Value.ToString() != string.Empty)
{
sbder.AppendFormat("{0}:{1}\r\n\t", dgvData.Columns[j].HeaderText, cell.Value.ToString());
}
}
}
dgvData[i, e.RowIndex].ToolTipText = sbder.ToString();
}
}
catch
{
}
}
要延长这个显示时间
会飞的孩纸
2012-03-29
打赏
举报
回复
上面两种方法试过,不行啊!
觉悟之时
2012-03-28
打赏
举报
回复
private void myRadGridView1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)
{
ToolTip toolTip = this.myRadGridView1.ElementTree.ComponentTreeHandler.Behavior.ToolTip;
toolTip.AutoPopDelay = 2000;
e.ToolTipText = "Hello";
}
private void radGridView_ToolTipTextNeeded(object sender, ToolTipTextNeededEventArgs e)
{
RadElement element = sender as RadElement;
if (element == null)
{
return;
}
ComponentBehavior behavior = (element.ElementTree.ComponentTreeHandler as IComponentTreeHandler).Behavior;
PropertyInfo toolTipProperty = typeof(ComponentBehavior).GetProperty("ToolTip", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetProperty);
object toolTip = toolTipProperty.GetValue(behavior, null);
Type radToolTipType = toolTip.GetType();
PropertyInfo automaticProperty = radToolTipType.GetProperty("AutomaticDelay");
PropertyInfo autoPopDelayProperty = radToolTipType.GetProperty("AutoPopDelay");
PropertyInfo initialDelayProperty = radToolTipType.GetProperty("InitialDelay");
PropertyInfo reshowDelayProperty = radToolTipType.GetProperty("ReshowDelay");
int automaticDelay = 60000000;
int autoPopDelay = 60000000;
int initialDelay = 60000000;
int reshowDelay = 60000000;
automaticProperty.SetValue(toolTip, automaticDelay, null);
autoPopDelayProperty.SetValue(toolTip, autoPopDelay, null);
initialDelayProperty.SetValue(toolTip, initialDelay, null);
reshowDelayProperty.SetValue(toolTip, reshowDelay, null);
e.ToolTipText = "This is tooltip text";
}
觉悟之时
2012-03-28
打赏
举报
回复
private void timer1_Tick(object sender, EventArgs e)
{
toolTip1.Active = false;
toolTip1.Active = true;
}
把timer控件的时间设置长一点试试。
vb
.net
DataGridView
控件用法合集
vb
.net
操作
DataGridView
控件的用法的集合,包括: 1.
DataGridView
当前的单元格属性取得、变更 2.
DataGridView
编辑属性 3.
DataGridView
最下面一列新追加行非表示 4.
DataGridView
判断当前选中行是否为新追加的...
C#
datagridview
与数据源绑定后对数据的,增加,删除,插入,更新
int
row
Index
=
dataGridView
.Current
Row
.
Index
; if (
row
Index
!= -1) { dataTable.
Row
s.RemoveAt(
row
Index
); } ``` ### 插入数据 在
DataGridView
中,插入操作通常意味着在已有行的特定位置添加新行。由于...
【C#】完美实现ComBox多列下拉框+自动完成+
DataGridView
自定义列
灵活:数据源、下拉框内
显示
的列、列名、可搜索关键字等可自由定义 方便:可输可选/支持键盘操作/模糊过滤/自动完成匹配 标准:通过继承combobox实现,可单独使用,也可嵌入
datagridview
使用 感谢“随风飘散”
i
text
sharp.dll5.4.4
在
DataGridView
中
显示
数据后,可以利用i
Text
Sharp将数据导出为PDF,这涉及到创建新的PDF文档,设置页面布局,然后将每个单元格的数据转换为PDF元素,如文本和表格。 一个简单的示例可能会包括以下步骤: 1. 使用...
VB
.NET
datagridview
的操作
If IsDBNull(
DataGridView
1.Item(1, 1).Value) = True Then
DataGridView
1.Item(1, 1).Value = "空值" End If '删除所有行
DataGridView
1.
Row
s.Clear() '删除第一行
DataGridView
1.
Row
s.RemoveAt(0) '...
C#
111,126
社区成员
642,541
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章