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

[GUI管理] 按钮控件button改变景颜色和多行文体和显示图标三者不能同时有效

[复制链接]
发表于 2012-8-17 21:15:48 | 显示全部楼层 |阅读模式
本帖最后由 txxdhnt 于 2012-8-17 21:33 编辑

按钮控件button改变景颜色和多行文体和显示图标三者不能同时有效。

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GUIConstantsEx.au3>
#include <GuiButton.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>

Opt("MustDeclareVars", 1)

_Main()

Func _Main()
Local $hImage, $y = 70, $iIcon = 125, $btn[6], $rdo[6], $chk[6], $hImageSmall

GUICreate("Buttons", 1028, 600)
GUISetState()

$hImage = _GUIImageList_Create(32, 32, 5, 3, 6)
For $x = 6 To 11
_GUIImageList_AddIcon($hImage, "shell32.dll", $x, True)
Next



$btn[0] = GUICtrlCreateButton("Button1", 10, 10, 90, 50)
_GUICtrlButton_SetImageList($btn[0], $hImage)
Local $btnTitel="买入"&@CRLF&"600583"&@CRLF&"海油工程"&@CRLF&"5.78元"&@CRLF   &"3%"  &@CRLF &"1300"&@CRLF

For $x = 5 To 5
$btn[$x] = GUICtrlCreateButton( $btnTitel, 10, $y, 100, 100,$BS_MULTILINE)

GUICtrlSetStyle(-1, BitOR($BS_MULTILINE,$BS_BITMAP))

; GUICtrlSetBkColor($btn[$x], $GUI_BKCOLOR_TRANSPARENT )
;_GUICtrlButton_SetImageList($btn[$x], _GetImageListHandle(@ScriptDir&"\gray_buy_1.bmp", $iIcon + $x, True), 5)
_GUICtrlButton_SetImageList($btn[$x], $hImage)
$y += 100
; GUICtrlSetBkColor($btn[$x], 0xA0A0A4)
  GUICtrlSetColor($btn[$x], 0xff0000)
  GUICtrlSetStyle($btn[$x], BitOR($BS_MULTILINE,$BS_BITMAP))
Next




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

Exit
EndFunc   ;==>_Main

; using image list to set 1 image and have text on button
Func _GetImageListHandle($sFile, $nIconID = 0, $fLarge = False)
Local $iSize = 16
If $fLarge Then $iSize = 32

Local $hImage = _GUIImageList_Create(30, 100, 5, 3)
If StringUpper(StringMid($sFile, StringLen($sFile) - 2)) = "BMP" Then
_GUIImageList_AddBitmap($hImage, $sFile)
Else
_GUIImageList_AddIcon($hImage, $sFile, $nIconID, $fLarge)
EndIf
Return $hImage
EndFunc   ;==>_GetImageListHandle

本帖子中包含更多资源

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

×
发表于 2012-8-17 21:53:28 | 显示全部楼层
这看着已经不像Button了
发表于 2012-8-17 21:53:49 | 显示全部楼层
这看着已经不像Button了
发表于 2012-8-19 17:30:58 | 显示全部楼层
取button句柄,gdi画
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-24 01:00 , Processed in 0.082061 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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