以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  按钮禁止后的提示语  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=108494)

--  作者:有点辣
--  发布时间:2017/10/24 8:59:00
--  按钮禁止后的提示语
窗体有个按钮,希望当满足某个条件后,按钮是禁止状态,但同时鼠标悬停上面,能有个提示语,提示用户为啥按钮不能用了

测试发现,按钮是禁止状态时,不能显示提示语

请教老师有变通方法吗?


--  作者:有点甜
--  发布时间:2017/10/24 10:03:00
--  

timertick事件

 

http://www.foxtable.com/webhelp/scr/1301.htm

 

 

Dim cs() As String = {"button1", "button2", "button3"}
Dim p = System.Windows.Forms.Cursor.Current.Position
For Each c As String In cs
    Dim obj = e.form.controls(c).basecontrol
    Dim rc = obj.RectangleToScreen(obj.ClientRectangle)
    output.show(obj.name & rc.tostring & p.tostring)
    If rc.contains(p) Then
        msgbox(obj.name)
        Exit For
    End If
Next