bian123shao 发表于 2010-7-18 18:33:57

修改Button的caption

我想点击一下按钮,就更改按钮上面的文字

93779252 发表于 2010-7-18 19:26:25

我也想知道怎么弄```

jhun 发表于 2010-7-18 19:46:53

Dim $i=0
$Form1 = GUICreate("Form1", 333, 174, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 80, 56, 169, 49)
GUISetState(@SW_SHOW)

While 1
        If GUIGetMsg()=-3 Then Exit
        If GUIGetMsg()=$Button1 Then
                $i=$i+1
                GUICtrlSetData($Button1,"你已经点了我"&$i&"下了")
        EndIf
WEnd

afan 发表于 2010-7-18 19:48:26

GUICreate('')
$b = GUICtrlCreateButton('A', 100, 100, 150, 25)
GUISetState()
While 1
        $msg = GUIGetMsg()
        Switch $msg
                Case -3
                        Exit
                Case $b
                        If GuiCtrlRead($msg) = 'A' Then
                                GuiCtrlSetData($msg, 'B')
                        Else
                                GuiCtrlSetData($msg, 'A')
                        Endif
        EndSwitch
WEnd

netegg 发表于 2010-7-18 23:23:16

用_GUICtrlButton_Create做

rikthhpgf2005 发表于 2010-7-19 10:58:35

GuiCtrlSetData就ok
页: [1]
查看完整版本: 修改Button的caption