gpt4 book ai didi

c# - 如何向控件添加工具提示?

转载 作者:IT王子 更新时间:2023-10-29 03:31:30 25 4
gpt4 key购买 nike

我想在鼠标悬停在控件上时显示一个工具提示

如何在代码中同时在设计器中创建工具提示?

最佳答案

Here是你用代码做的文章

private void Form1_Load(object sender, System.EventArgs e)
{
// Create the ToolTip and associate with the Form container.
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 and Checkbox.
toolTip1.SetToolTip(this.button1, "My button1");
toolTip1.SetToolTip(this.checkBox1, "My checkBox1");
}

关于c# - 如何向控件添加工具提示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1339524/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com