Display a tooltip over a button using Windows Forms

后端 未结 9 1832
梦谈多话
梦谈多话 2020-11-29 17:37

How can I display a tooltip over a button using Windows Forms?

9条回答
  •  被撕碎了的回忆
    2020-11-29 18:11

    Sure, just handle the mousehover event and tell it to display a tool tip. t is a tooltip defined either in the globals or in the constructor using:

    ToolTip t = new ToolTip();
    

    then the event handler:

    private void control_MouseHover(object sender, EventArgs e)
    {
      t.Show("Text", (Control)sender);
    }
    

提交回复
热议问题