修改Button的caption
我想点击一下按钮,就更改按钮上面的文字 我也想知道怎么弄``` 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
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 用_GUICtrlButton_Create做 GuiCtrlSetData就ok
页:
[1]