English 中文(简体)
C# tooltip t 显示时间已足够长
原标题:C# tooltip doesn t display long enough

我有一个工具,正以图像上出现改观:

ToolTip tt = new ToolTip();
protected virtual void pictureBox_MouseHover(object sender, EventArgs e)
{
    tt.InitialDelay = 0;
    tt.SetToolTip(this.pictureBox, "Click  LIVE ...");
}

我的问题是,我的案文很长,工具消失得太快。 如何使这一工具更长时间展示?

最佳回答

Set the AutoPoplay propertyss_a>s要高一些——违约率达到5000(5秒)

<>Update: 我的错误:

The maximum time you can delay a popup is 5000 milliseconds. For longer durations, use the Show method to control the exact moment when the ToolTip is displayed.

因此,如果使用这种方法,你可以将工具拖到5秒以上,而是需要利用展览在用户对图像箱的冲击时明确展示工具ip。 仅取代您的以下呼吁:SetToolTip,到Show,载于MouseHover;

ToolTip tt = new ToolTip();
protected virtual void pictureBox_MouseHover(object sender, EventArgs e)
{
    tt.Show("Click  LIVE ...", this.pictureBox, 10000);
}
问题回答

与Justin所描述的答案不同的是,我无法利用<代码>how方法显示工具包的时间超过5秒。

另一hang是<条码>AutomaticDelay财产。 长期短篇——如果你想要的是条码,则,not >。

设定这一财产将automatically set...:MSDN:

AutoPopDelay = 10×自动步枪

初步数据

ReshowDelay = (0.2) x autoDelay

这里为我工作的法典:

ToolTip tt = new ToolTip();
private void someObjectName_MouseHover(object sender, EventArgs e) {
    tt = new ToolTip
    {
        AutoPopDelay = 15000,  // Warning! MSDN states this is Int32, but anything over 32767 will fail.
        ShowAlways = true,
        ToolTipTitle = "Symbolic Name",
        InitialDelay = 200,
        ReshowDelay = 200,
        UseAnimation = true
    };
    tt.SetToolTip(this.someObjectName, "This is a long message");
}

Bonus:

private void someObjectName_MouseLeave(object sender, EventArgs e)
    {
        tt.Active = false;
    }

3. 确定自耕不动产的价值

 tt.AutoPopDelay = 10000;

rel=“nofollow”>。 i

这将使你能够展示一定数量的半流体的长篇文字。 而且,如果你的案文太长,那么你可以在案文之间插入NewLine,以便其总结下来,而不是作为一个横跨形式的长期工具。

我为我找到了以下步骤:

规定。 和MSDN Link

Doesn t seem to be mentioned. Setting ToolTipService.ShowDuration="20000" on the parent works for me. MSDN doesn t say but it s in milliseconds.





相关问题
Bring window to foreground after Mutex fails

I was wondering if someone can tell me what would be the best way to bring my application to the foreground if a mutex was not able to be created for a new instance. E.g.: Application X is running ...

How to start WinForm app minimized to tray?

I ve successfully created an app that minimizes to the tray using a NotifyIcon. When the form is manually closed it is successfully hidden from the desktop, taskbar, and alt-tab. The problem occurs ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

Handle DataTable.DataRow cell change event

I have a DataTable that has several DataColumns and DataRow. Now i would like to handle an event when cell of this DataRow is changed. How to do this in c#?

Apparent Memory Leak in DataGridView

How do you force a DataGridView to release its reference to a bound DataSet? We have a rather large dataset being displayed in a DataGridView and noticed that resources were not being freed after the ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

WPF-XAML window in Winforms Application

I have a Winforms application coded in VS C# 2008 and want to insert a WPF window into the window pane of Winforms application. Could you explain me how this is done.

热门标签