找回密码
 加入
搜索
查看: 8519|回复: 11

[GUI管理] 如何取消按钮的XP样式

  [复制链接]
发表于 2011-10-24 21:34:23 | 显示全部楼层 |阅读模式
比如如果XP启用了风格
那按钮就会根据风格改变

我需要他是不管风格如何改变,都是无风格状态
发表于 2011-10-25 02:10:12 | 显示全部楼层
按照你的要求只能如此:
自定义按钮的形状和大小(官方)
http://www.autoitx.com/thread-11608-1-1.html

实测:
Aero风格下:

传统风格下:

本帖子中包含更多资源

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

×
发表于 2011-10-25 04:51:09 | 显示全部楼层
回复 1# heavenm
不管环境?可能不太好整
发表于 2011-10-25 08:25:15 | 显示全部楼层
本帖最后由 happytc 于 2011-10-25 08:26 编辑

回复 1# heavenm


#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <WinAPIEx.au3> ;若没有WinAPIEx.au3文件,则注释掉此行和第10行(_WinAPI_SetWindowTheme($hButton, 0, 0)),开启11行(DllCall行)

Local $hGUI, $Button, $hButton

$hGUI = GUICreate("Test", 500, 500)
$Button = GUICtrlCreateButton("Test", 10, 10, 80, 30)
$hButton = GUICtrlGetHandle($Button)
_WinAPI_SetWindowTheme($hButton, 0, 0)
;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", $hButton, "wstr", 0, "wstr", 0)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

评分

参与人数 2金钱 +52 贡献 +10 收起 理由
lynfr8 + 22 + 5
heavenm + 30 + 5

查看全部评分

 楼主| 发表于 2011-10-25 21:09:59 | 显示全部楼层
果然 神人很多 真的有方法
感谢4楼
不过这些东西我怎么能知道呢
发表于 2011-10-26 22:19:15 | 显示全部楼层
本帖最后由 131738 于 2011-10-26 22:21 编辑

回复 2# lynfr8

按照连接复制代码运行后, 提示 3 处错误:
F:\GUICtrlSetOnHover_UDF.au3(15,106) : 错误: Opt() 被不合法的参数调用 1 : "OnExitFunc".
    这个错误查看帮助得知 "OnExitFunc" 于 2009-12-18 v3.3.2.0 删除,用 OnAutoItExitRegister 替换

F:\shapedcontrols_udf.au3(21,61) : WARNING: $avgcol: 使用前并未进行声明.
    这个错误设立个:  Global $avgcol = "FF0000"  对不对也不知道?

F:\shapedcontrols_udf.au3(799,51) : 错误: StringRERange(): 未定义的函数.
    这个就不知如何解决了?
谢谢!!!
发表于 2011-10-26 22:23:51 | 显示全部楼层
回复 5# heavenm


    无它,唯手熟尔!
发表于 2011-10-27 00:29:06 | 显示全部楼层
回复 6# 131738


    强制执行即可
发表于 2011-10-27 02:24:47 | 显示全部楼层
回复  131738


    强制执行即可
lynfr8 发表于 2011-10-27 00:29


喔。。。。。。。。
发表于 2011-10-27 02:51:26 | 显示全部楼层
回复 4# happytc
不对呀,貌似无效呀
发表于 2011-10-27 02:57:11 | 显示全部楼层
回复 10# netegg
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
Local $hGUI1,$hGUI2,$Button1, $hButton1,$Button2
$hGUI1 = GUICreate("Test1", 500, 500)
$Button1 = GUICtrlCreateButton("Test", 10, 10, 80, 30)
$hButton1 = GUICtrlGetHandle($Button1)
DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", $hButton1, "wstr", 0, "wstr", 0)
GUISetState()
$hGUI2 = GUICreate("Test2", 500, 500)
$Button2 = GUICtrlCreateButton("Test", 10, 10, 80, 30)
GUISetState()
 
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
发表于 2011-10-27 03:46:35 | 显示全部楼层
回复 11# lynfr8
谢了,知道了,刚开始我搞错用的环境了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-2 15:21 , Processed in 0.084208 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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