Gui Add Button Variable

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Gui Add Button Variable

Re: Gui Add Button Variable

Post by pongobernd » 14 Sep 2023, 01:11

habs so gelöst...

Code: Select all

Gui, Add, Button, w200 h25 gWaehlen, Andreas 163
...
...
WAEHLEN:
StringSplit, Nummer, % A_GuiControl, ' '
Nummer = %Nummer2%%
[Mod edit: [code][/code]-Tags hinzugefügt. Bitte in Zukunft selbst verwenden!]

Danke !

Re: Gui Add Button Variable

Post by just me » 13 Sep 2023, 09:56

Wenn Du auf einen Button klicken und dann Informationen über diesen Button auslesen willst, brauchst Du ein G(oto)-Label.

Code: Select all

Gui, Add, Button, w200 h25 gWaehlen vN154 gGeklickt, Kurt 154 ; Nummer = 154
...
...
Geklickt:
Nummer := SubStr(A_GuiControl, 2) ; das 'N' im Variablennamen ausfiltern
MsgBox, %Nummer%
Return

Re: Gui Add Button Variable

Post by pongobernd » 13 Sep 2023, 08:38

hallo du,

Nein, die Variable soll nicht für Goto verwendet verwenden, sondern Nummer = 154 definiert werden.

Gui, Add, Button, w200 h25 gWaehlen vNummer154, Kurt 154 ; Nummer = 154
Gui, Add, Button, w200 h25 gWaehlen vNummer150, Anita 150 ; Nummer = 150

Gui dient zum ansteuern des Tischtelefons und es sind mehrere Buttons für die ich nicht extra ein GoTo bauen will nur um Nummer auf das richtige zu setzen.

lG Bernd.

Nachtrag; Wäre auch ok wenn ich "Kurt 154" den Namen des Buttons bekomme...

Lösung: % A_GuiControl gibt "Kurt 154" und dann mit StringSplit aufteilen..

Re: Gui Add Button Variable

Post by just me » 13 Sep 2023, 08:08

Moin,

meinst Du so etwas?

Code: Select all

Var := 154
Gui, Add, Button, w200 h25 gN%Var%, Kurt %Var%
; oder
Gui, Add, Button, w200 h25 vBtn%Var%, Kurt %Var%

Gui Add Button Variable

Post by pongobernd » 13 Sep 2023, 07:49

Servus,

kann ich in der Zeile "Gui, Add, Button, w200 h25 gN154, Kurt 154" anstatt goto gleich die Variable Nummer auf 154 setzen?

lg Bernd.

Top