C# 如何增加工具提示显示时间?
我有一个GridView,在它的RowDataBound事件中,我指定工具提示如下:C# 如何增加工具提示显示时间?,c#,asp.net,visual-studio-2008,time,tooltip,C#,Asp.net,Visual Studio 2008,Time,Tooltip,我有一个GridView,在它的RowDataBound事件中,我指定工具提示如下: protected void gv_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (gv.HeaderRow != null && e.Row.RowType == DataControlRowType.DataRow) { e.Row.To
protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
if (gv.HeaderRow != null && e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.ToolTip = "Remarks: " + ((Label)e.Row.FindControl("lblRemarks")).Text;
}
}
catch (Exception ex)
{
BussinessLayer.RIBOException.Instance.HandleMe(this, ex);
}
}
在这里,我想延长工具提示的显示时间。
如何执行此操作?设置ToolTipService.ShowDuration属性。您需要使用
ToolTipService
,特别是
设置工具提示后,您应该能够执行以下操作:
ToolTipService.ShowDuration(e.Row, 10000)
这可以工作,提供间距和其他格式选项。上述被接受的选项不起作用
<div runat="server" class="tooltip" id="divHowTo" style="display: inline-block; width:75px" data-tip="If you have problems: 

1.) Enter a users id 

2.) Choose a corresponding domain for the pin 

3.) Verify resolved name is correct 

4.) (If adding) Browse for Picture (jpg/png format) (square resolution) (240px X 240px or larger) 

5.) Choose a button to add or delete or view or save or clear " >
<asp:Image ID="imgHowTo" runat="server" ImageUrl="Images/howTo1s.jpg" Height="73px" Width="73px"/>
</div>
15000
尝试以下链接:ToolTipService适用于WPF,问题用ASP.NetW标记。当我键入ToolTipService时,intellisense不会出现。为什么以及如何获得该物业?我需要使用任何名称空间吗?在asp.net中,您必须在javascript中实现自己的tooltip,并在此处引入延迟属性。ToolTipService适用于WPF,问题标记为asp.net。当我键入ToolTipService时,intellisense不会出现。为什么以及如何获得该物业?是我需要使用任何名称空间吗?@thevan-为什么这个标记为已接受,而这不适用于您,也不适用于ASP.NET中的任何其他人?已经有一段时间了,但我相信这个问题在第一次发布时被错误地标记为WPF。我不确定它为什么被接受……作为记录,如果我们谈论的是WPF,持续时间是以毫秒为单位的。
.tooltip {
display:inline-block;
width:64px;
height:64px;
position:relative;
margin:25px;
background-repeat: no-repeat;
background-position:50% 50%;
background-size:100%;
text-align:center;
line-break:auto;
white-space:pre-line;
}
.tooltip:hover:after {
display:inline-block;
position:absolute;
top:-25px;
left:50%;
height:400px;
content: attr(data-tip);
font:bold 10px/14px Arial, sans-serif;
background:#f0f0f0;
color:#333;
white-space:pre-line;
border:1px solid #665;
padding:2px 4px;
width:150px;
margin:0 0 0 -75px;
border-radius:3px;
line-break:auto;
}
.tooltip:hover:before {
border-top: 10px solid #665;
border-top: 10px solid #665;
margin-top: 5px;
content: "";
position: absolute;
border-left: 5px solid transparent;
border-right: 10px solid transparent;
top:-15px;
left: 50%;
margin-left: -10px;
line-break:auto;
white-space:pre-line;
}
<Button x:Name="btnHelp" ToolTip="For new paragraph : press Enter 
For new line : press Shift+Enter">
<ToolTipService.ShowDuration>15000</ToolTipService.ShowDuration>
</Button>