当鼠标移到Button控件时自动提示

先添加ToopTip控件到Form窗体上,命名:btnStartUpToolTip

然后添加Button的MouseMove事件处理函数,如下:

private void btnStartUp_MouseMove(object sender, MouseEventArgs e)
        {
            if ( sender is Button )
            {
                Button btn=sender as Button;
                this.btnStartUpToolTip.SetToolTip(btn, "启动");
            }
        }

posted @ 2013-03-26 09:37  Predator  阅读(440)  评论(0编辑  收藏  举报