C# 未显示Windows工具提示
我有一个代码,它以标准方式设置Winforms控件的工具提示:-C# 未显示Windows工具提示,c#,tooltip,C#,Tooltip,我有一个代码,它以标准方式设置Winforms控件的工具提示:- // Create the ToolTip and associate with the Form container. ToolTip toolTip = new ToolTip(); // Set up the delays for the ToolTip. toolTip.AutoPopDelay = 15000;
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
工具提示工具提示=新工具提示()
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
设置工具提示(控件,文本)
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
在同一个应用程序中,有一个窗口正在使用Direct3D SDK以每秒5帧的速度渲染某些图像的电影。现在,在渲染电影时,即在播放模式下,工具提示永远不会出现。我一暂停电影,工具提示就开始出现
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
- 案例1:
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
工具提示工具提示=新工具提示()
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
toolTip.InitialDelay=50
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
设置工具提示(控件,文本)
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
现在,只要我引入一个初始延迟,工具提示就会被渲染,而不管电影是否正在播放
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
- 案例2:
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
有人能纠正我在工具提示渲染中的错误吗?我使用的是.Net 2.0&C#。D3D视频和工具提示都使用了覆盖层(我使用的屏幕捕获程序中,有多少因为这个原因而不捕获工具提示!);所以我相信你看到了一些来自D3D叠加的干扰
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
可能是视频在绘制工具提示,因为它是在播放过程中渲染的-所以工具提示在那里,你就是看不到它
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
然而,我很困惑,为什么设置初始延迟会突然使它工作起来!也就是说,InitialDelay控制工具提示第一次显示时应用于工具提示的延迟,因此它可能与更改工具提示获取要显示的覆盖曲面的方式有关
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
当然,我会使用它作为解决方法,而不是像另一个答案所说的那样,重复构建和分配工具提示,因为它可能会破坏资源
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
我会找到尽可能小的初始延迟,然后继续
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
最后,我们在这里讨论的是什么版本的Windows和DX?还有几个其他的线程,开始和里面的GameDev链接,关于工具提示和DirectX的问题;并指出一个事实,这里发生的事情可能不仅仅是一点.Net的怪异 请参见上的工具提示组件(Windows窗体)。具体来说,请查看如何:在设计时在为Windows窗体上的控件设置工具提示
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
您没有正确使用工具提示。您链接到的示例仅显示如何创建工具提示,而不是如何使用它。根据您的情况修改此示例。应该有用。您应该设置所有这些属性
// Create the ToolTip and associate with the Form container.
ToolTip toolTip = new ToolTip();
// Set up the delays for the ToolTip.
toolTip.AutoPopDelay = 15000;
toolTip.InitialDelay = 300;
toolTip.ReshowDelay = 300;
// Force the ToolTip text to be displayed whether or not the form is active.
toolTip.ShowAlways = true;
// Set up the ToolTip text for the Buttons
toolTip.SetToolTip(this.button2, "TooltipText1");
toolTip.SetToolTip(this.button3, "TooltipText2");
这不一定是Wiki。这不是创建工具提示的标准方法。从实际角度来看,MSDN示例是错误的。该示例仅说明如何将工具提示创建为控件,而不是如何将工具提示用作组件。您希望将其用作组件。