Displaying tooltip on mouse hover of a text

前端 未结 9 1038
盖世英雄少女心
盖世英雄少女心 2020-11-29 07:22

I want to display a tooltip when the mouse hovers over a link in my custom rich edit control. Consider the following text:

We all sleep

9条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 07:58

    I would also like to add something here that if you load desired form that contain tooltip controll before the program's run then tool tip control on that form will not work as described below...

        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            objfrmmain = new Frm_Main();
            Showtop();//this is procedure in program.cs to load an other form, so if that contain's tool tip control then it will not work
            Application.Run(objfrmmain);
    
    
        }
    

    so I solved this problem by puting following code in Fram_main_load event procedure like this

        private void Frm_Main_Load(object sender, EventArgs e)
        {
            Program.Showtop();
        }
    

提交回复
热议问题