wie bereits erwähnt... erst aktuellen name auslesen, und bei ungleichheit ändern...
code als einfacher automat aufgebaut:
Code:
Dim $btnName[2] = ['Text1','Text2'], $activeName=False
GUICreate('blubb', 100, 50, Default, Default, 0x10C80000)
$btn = GUICtrlCreateButton($btnName[$activeName], 10, 10, 105, 30)
While 1
Switch GUIGetMsg()
Case -3
ExitLoop
Case $btn
$activeName = Not $activeName
Case Else
If GUICtrlRead($btn)<>$btnName[$activeName] Then GUICtrlSetData($btn, $btnName[$activeName])
EndSwitch
WEnd
Edit:
Bevor wieder fragen kommen, hier eine mögliche lösung mit input <.<:
Code:
Dim $data
GUICreate('blubb', 126, 40, Default, Default, 0x10C80000)
$btn = GUICtrlCreateButton('', 0, 0, 126, 20)
$input = GUICtrlCreateInput('001', 0, 20, 126, 20)
While 1
Switch GUIGetMsg()
Case -3
ExitLoop
Case Else
$data = GUICtrlRead($input)
If GUICtrlRead($btn)<>$data Then GUICtrlSetData($btn, $data)
EndSwitch
WEnd