找回密码
 加入
搜索
查看: 3850|回复: 19

提示信息问题(提交为“已解决”后就没再看,傻了!2种方法!)

[复制链接]
发表于 2008-7-8 14:37:38 | 显示全部楼层 |阅读模式
如下图为深度的优化工具:
当鼠标移动到每个服务选项时,在右边的简介框里都能作出相应文字显示,我实验过GUICtrlSetTip,那种提示方式不能控制在简介框里的显示,求教~

[ 本帖最后由 powerofos 于 2008-7-10 14:56 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2008-7-8 15:08:40 | 显示全部楼层
继续等~。。。。。
发表于 2008-7-8 23:10:17 | 显示全部楼层
GuiCtrlSetData

评分

参与人数 1金钱 +5 收起 理由
powerofos + 5

查看全部评分

发表于 2008-7-9 04:31:58 | 显示全部楼层
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 432, 377, 193, 125)
$Label1 = GUICtrlCreateLabel("Label1          dfsssssssssssssssssssssssssss", 128, 168, 255, 40)
GUICtrlSetTip(-1,"难道这样不行吗?")
$Group1 = GUICtrlCreateGroup("Group1", 80, 120, 281, 129)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd


[ 本帖最后由 漠北雪~狼 于 2008-7-9 04:33 编辑 ]

评分

参与人数 1金钱 +2 收起 理由
powerofos + 2

查看全部评分

发表于 2008-7-9 10:25:09 | 显示全部楼层
LZ的问题是个鼠标事件问题,捕获鼠标的移动事件,判断所在区域,执行相应的文本变化,应该还是可以的。
 楼主| 发表于 2008-7-9 12:38:09 | 显示全部楼层
昨天发的帖子,再次感谢netegg,上次您的回答,我根据你的提示,解决了上个问题,这个问题仍然没解决~感谢,另外,我发现“顽固不化”经常出现在次版块,乐于助人,给他个勋章~

[ 本帖最后由 powerofos 于 2008-7-9 12:40 编辑 ]
 楼主| 发表于 2008-7-9 12:43:30 | 显示全部楼层
漠北雪~狼:  
    您提供的方法我能写出来,可是不能控制提示信息的显示位置啊,我要的是提示信息在我指定的框框里面显示,有办法办到吗?

如:顽固不化 所言,他理解对了,能具体点吗?
要首先捕获鼠标事件?
发表于 2008-7-9 13:29:01 | 显示全部楼层
只是一个思路,鼠标移动提示可能会“频闪”,只要一个判断不在重写就没事了,自己去细化吧。
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 357, 124, 193, 125)
$Button1 = GUICtrlCreateButton("按钮1", 16, 16, 161, 33, 0)
$Button2 = GUICtrlCreateButton("按钮2", 16, 72, 161, 33, 0)
$Edit1 = GUICtrlCreateEdit("", 200, 16, 145, 89)
GUICtrlSetData(-1, "捕获移动示例,"&@CRLF&"BY 顽固不化")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg(1)
                Switch $nMsg[0]
                        Case $GUI_EVENT_CLOSE
                                Exit
                        Case $GUI_EVENT_MOUSEMOVE
                                if $nMsg[3]>16 and $nMsg[3]<16+161 And $nMsg[4]>16 And $nMsg[4]<16+33 Then 
                                        GUICtrlSetData($Edit1,"鼠标在第一个按钮上")
                                ElseIf $nMsg[3]>16 and $nMsg[3]<16+161 And $nMsg[4]>72 And $nMsg[4]<72+33 Then 
                                        GUICtrlSetData($Edit1,"鼠标在第二个按钮上")
                                Else
                                        GUICtrlSetData($Edit1,"捕获移动示例,"&@CRLF&"BY 顽固不化")
                                EndIf
                        Case $Button1
                                GUICtrlSetData($Edit1,"干'按钮1'的事去吧")
                        Case $Button2
                                GUICtrlSetData($Edit1,"干'按钮2'的事去吧")
        EndSwitch
WEnd

评分

参与人数 1金钱 +3 收起 理由
powerofos + 3

查看全部评分

 楼主| 发表于 2008-7-9 15:37:23 | 显示全部楼层
考完试,一觉醒来,就有好消息~GOOD! 感谢 顽固不化 的提供,回头试验去~
 楼主| 发表于 2008-7-9 16:07:39 | 显示全部楼层
原来GuiGetMsg还能返回高级模式的数组~~~~受教了,谢谢~
发表于 2008-7-9 16:26:22 | 显示全部楼层
顽固不化是好样的
发表于 2008-7-9 18:25:48 | 显示全部楼层
理论上用GUIGetCursorInfo更好一点
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 357, 124, 193, 125)
$Button1 = GUICtrlCreateButton("按钮1", 16, 16, 161, 33, 0)
$Button2 = GUICtrlCreateButton("按钮2", 16, 72, 161, 33, 0)
$Edit1 = GUICtrlCreateEdit("", 200, 16, 145, 89)
GUICtrlSetData(-1, "捕获移动示例," & @CRLF & "BY 顽固不化")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg(1)
        Switch $nMsg[0]
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        GUICtrlSetData($Edit1, "干'按钮1'的事去吧")
                Case $Button2
                        GUICtrlSetData($Edit1, "干'按钮2'的事去吧")
        EndSwitch
        $mousepos = GUIGetCursorInfo($Form1)
        Switch $mousepos[4]
                Case $Button1
                        GUICtrlSetData($Edit1, "鼠标在第一个按钮上")
                Case $Button2
                        GUICtrlSetData($Edit1, "鼠标在第二个按钮上")
                Case Else
                        GUICtrlSetData($Edit1, "捕获移动示例," & @CRLF & "BY 顽固不化")
        EndSwitch
WEnd

实际使用中,为避免闪烁,可用guictrlread读取后加以判断,
 楼主| 发表于 2008-7-9 18:33:13 | 显示全部楼层
哇,再有更新,可喜可贺!感谢楼上,可惜今天的金钱用完了~
 楼主| 发表于 2008-7-9 18:34:52 | 显示全部楼层
明天补上,一定一定!
 楼主| 发表于 2008-7-9 18:47:12 | 显示全部楼层

回复 12# pcbar 的帖子

没加判断的话,比 顽固不化 提供的方法还要闪~
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-17 15:37 , Processed in 0.091824 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表