找回密码
 加入
搜索
查看: 1240|回复: 3

是否可以使用文字按钮

[复制链接]
发表于 2009-8-15 22:29:42 | 显示全部楼层 |阅读模式
本帖最后由 四海皆狂龙 于 2009-8-16 13:32 编辑

象网页这样,可以通过文字触发事件的。另外如何才可以自定义皮肤。
发表于 2009-8-16 02:25:10 | 显示全部楼层
其实跟按钮是一样的
While 1
  $nMsg = GUIGetMsg()
  Switch $nMsg
         Case $LblACNLink
                 ShellExecute("www.autoit.cn")              
EndSwitch
WEnd

自定义皮肤的话,给你实例吧。
ACN软件专题站
http://www.autoit.org.cn/column/zhongwen-forum/au3VistaSkin.html
当然论坛里面也有很多例子,可以看下。
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
Opt("OnExitFunc","Quit");设置在 AutoIt 退出时将调用的函数(Quit)

$Form = GUICreate("Vista皮肤", 180, 66, 192, 124)
;加载皮肤
Dim $Dll
FileInstall("SkinCrafterDll.dll", @TempDir& "\SkinCrafterDll.dll",1)
FileInstall("vista_style.skf", @TempDir& "\vista_style.skf",1)
$Dll = DllOpen(@TempDir& "\SkinCrafterDll.dll")
DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1)
DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", @TempDir& "\vista_style.skf")
DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Form, "int", 25)
DllCall($Dll, "int:cdecl", "ApplySkin")

$Button = GUICtrlCreateButton("关于", 45, 8, 91, 49, 0)
GUICtrlSetFont(-1, 24, 800, 0, "仿宋_GB2312")
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Quit()
        Case $Button
            MsgBox(0,"关于","Autoit软件专题站" & @CRLF & "" & @CRLF & "www.autoit.org.cn")
            If MouseDown("left")=1 Then
                $url="http://www.autoit.org.cn"
                Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe -new " & $url)
            EndIf   
    EndSwitch
WEnd

;退出加载皮肤
Func Quit()
    GUISetState(@SW_HIDE)
    DllCall($dll, "int", "DeInitDecoration")
    DllCall($dll, "int", "RemoveSkin")
    DllClose($dll)
    FileDelete ( @TempDir&"\SkinCrafterDll.dll" )
    FileDelete ( @TempDir&"\vista_style.skf" )
    Exit
EndFunc
 楼主| 发表于 2009-8-16 06:01:52 | 显示全部楼层
其实跟按钮是一样的
While 1
  $nMsg = GUIGetMsg()
  Switch $nMsg
         Case $LblACNLink
                 ShellExecute("www.autoit.cn")              
EndSwitch
WEnd

自定义皮肤的话,给你实例 ...
南一 发表于 2009-8-16 02:25

皮肤的我找到了,但是类似于网页这样的文字按钮能不能给个比较完整的例子。
 楼主| 发表于 2009-8-16 06:11:43 | 显示全部楼层
其实跟按钮是一样的
While 1
  $nMsg = GUIGetMsg()
  Switch $nMsg
         Case $LblACNLink
                 ShellExecute("www.autoit.cn")              
EndSwitch
WEnd

自定义皮肤的话,给你实例 ...
南一 发表于 2009-8-16 02:25

谢谢了。
文字按钮原来就是文字标签句柄替换那个开关位置,明白了。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-2 11:29 , Processed in 0.076772 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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