zhenglei 发表于 2010-4-21 16:09:03

按钮加了ICO就不显示按钮原来的文字了。。

本帖最后由 zhenglei 于 2010-4-21 16:26 编辑

$Button1 = GUICtrlCreateButton("my", 10, 20, 100, 40,$BS_ICON)
GUICtrlSetImage(-1,"shell32.dll", 165)

这样的话 只有 ICO 。。按钮上却没有了 文字。 就现在这个案例。。 如何让它可以显示出 按钮文字MY ??

感谢l4ever 的回答 。。我现在的情况是按钮不是其他的东东。。。 不要跑题了哦。。 就现在这个情况。 。如何解决???

l4ever 发表于 2010-4-21 16:20:21

重新创建一个label


#include <GUIConstantsEx.au3>

GUICreate("L4EVER",200,200,-1,-1)

$icon = GUICtrlCreateIcon("shell32.dll", 2, 10, 10)
$l1 = GUICtrlCreateLabel("图标例子", 5, 50)

GUISetState(@SW_SHOW)
While 1
        $msg = GUIGetMsg()
        Switch $msg
                Case $GUI_EVENT_CLOSE
                        ExitLoop
                Case $icon
                        show()
                Case $l1
                        show()
        EndSwitch
       
        Sleep(10)
WEnd

Func show()
        ShellExecute("http://l4ever.cn")
        EndFunc

C.L 发表于 2010-4-21 17:41:20

$Button1 = GUICtrlCreateButton("my", 10, 20, 100, 40,$BS_ICON)
GUICtrlSetImage(-1,"shell32.dll", 165)

把$BS_ICON样式去掉
$Button1 = GUICtrlCreateButton("my", 10, 20, 100, 40)
GUICtrlSetImage(-1,"shell32.dll", 165)

3mile 发表于 2010-4-21 17:49:14

#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>

Opt("MustDeclareVars", 1)

_Main()

Func _Main()
        Local $hImage, $btn, $hImageSmall
       
        GUICreate("Buttons", 510, 400)
        GUISetState()

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

        $hImageSmall = _GUIImageList_Create(16, 16, 5, 3, 6)
        For $x = 6 To 11
                _GUIImageList_AddIcon($hImageSmall, "shell32.dll", $x)
        Next

        $btn = GUICtrlCreateButton("Button1", 10, 10, 90, 50)
        _GUICtrlButton_SetImageList($btn, $hImage)

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

        Exit
EndFunc   ;==>_Main

zhenglei 发表于 2010-4-21 18:52:01


3mile 发表于 2010-4-21 17:49 http://www.autoitx.com/images/common/back.gif


    老大的方法可行。。但我用SkinH_VB6.dll 皮肤按钮显示失败!!!!!

我用以下方法 同时加载皮肤。。是可以显示出图标的。 但不显示文字。。 郁闷死。。
$Button1 = GUICtrlCreateButton("my", 10, 20, 100, 40,$BS_ICON)
GUICtrlSetImage(-1,"shell32.dll", 165)

netegg 发表于 2010-4-22 04:27:17

回复 5# zhenglei

目前的所有皮肤都不是很完善,想加的话只能自己慢慢调,没有统一语法或者方法
页: [1]
查看完整版本: 按钮加了ICO就不显示按钮原来的文字了。。