2011-04-13 36 views

回答

2

您正在寻找ToolTip component

+1

这不是一个标准的提示,是什么呢?工具提示是鼠标悬停 - 这是一个验证弹出窗口。 – 2011-04-13 15:00:10

+0

@Dan:您可以手动显示工具提示;如果出现错误,请调用“Show”。 – SLaks 2011-04-13 15:10:19

0

不,开箱即用。有一个工具提示,但它看起来不像你展示的那个。

但是你可以通过创建一个自定义控件。

3

的DevExpress有一个免费的ToolTipController类(以及ErrorProvider控件和HintController类),你可以在这里:https://www.devexpress.com/Products/Free/NetOffer/提供你想要什么。我每天使用它。您可以简单地将文本框拖放到表单上,并根据需要设置其工具提示,工具提示控制器和工具提示图标属性(也可以使用验证事件将错误消息显示为工具提示)。

0

存在的WinForms错误提供商要做到这一点,但如果你想显示这样你可以使用工具提示

//创建工具提示和准用Form容器。 ToolTip toolTip1 = new ToolTip();

 // Set up the delays for the ToolTip. 
    toolTip1.AutoPopDelay = 5000; 
    toolTip1.InitialDelay = 1000; 
    toolTip1.ReshowDelay = 500; 
    // Force the ToolTip text to be displayed whether or not the form is active. 
    toolTip1.ShowAlways = true; 

    // Set up the ToolTip text for the Button . 
    toolTip1.SetToolTip(this.button1, "My button1"); 

参考MSDN