在一个表单中,我有一个标签,但标签文本超出了面板范围,当鼠标悬停在标签上一段时间显示一个包含所有文本的弹出窗口时,我该怎么办?
编辑:这里的代码:
public partial class AppMenuItem : UserControl
{
public string path;
public string name
{
get { return label1.Text; }
}
public AppMenuItem(string path, string name)
{
InitializeComponent();
label1.Text = name;
this.path = path;
pictureBox1.Image = ShortcutsHelper.GetIcon(path);
}
private void pinToStartToolStripMenuItem_Click(object sender, EventArgs e)
{
TilesHelper.AddTile(this.name, this.path);
}
private void label1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
contextMenuStrip1.Show(this.PointToScreen(Point.Empty));
}
else
{
System.Diagnostics.Process.Start(path);
((AppForm)this.ParentForm).DialogResult = DialogResult.OK;
((AppForm)this.ParentForm).Close();
((AppForm)this.ParentForm).textBox1.Text = "";
}
}
private void label1_MouseHover(object sender, EventArgs e)
{
new ToolTip().Show(this.name, this.ParentForm);
}
}