Page 1 sur 1
[R] Récupérer une variable.
Posté : ven. 06 mars 2015 11:51
par camil
Bonjour,
Je souhaiterai de l'aide pour savoir comment on récupère ce que rentre sur $input1 pour la reporter sur $Output2.
$input1 = $input2 sa marche pas ?
Merci d'avance.
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $input1, $input2
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 280, 233, 630, 255)
$Button1 = GUICtrlCreateButton("Button1", 16, 24, 97, 33)
$Button2 = GUICtrlCreateButton("Button2", 166, 24, 97, 33)
$Output1 = GUICtrlCreateLabel("Output1", 24, 88,121, 17)
$Output2 = GUICtrlCreateLabel("Output2", 184, 88,121, 17)
$Input1 = GUICtrlCreateInput("Input1", 24, 136, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GUIGetMsg()
if $msg=-3 then Exit
if $msg=$button1 then button1()
if $msg=$button2 then button2()
WEnd
Func button1()
GUICtrlSetData($Output1,GUICtrlRead($input1))
$input2 = $input1
EndFunc
Func button2()
GUICtrlSetData($Output2,($input2))
EndFunc
Re: [..] récupérer une variable.
Posté : ven. 06 mars 2015 16:22
par Oversid3
Hello,
Je ne comprend pas bien ton soucis, tu l'as bien fait pour $Output1, c'est la même chose pour $Output2 :
Et sinon le code en entier
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $input1, $input2
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 280, 233, 630, 255)
$Button1 = GUICtrlCreateButton("Button1", 16, 24, 97, 33)
$Button2 = GUICtrlCreateButton("Button2", 166, 24, 97, 33)
$Output1 = GUICtrlCreateLabel("Output1", 24, 88,121, 17)
$Output2 = GUICtrlCreateLabel("Output2", 184, 88,121, 17)
$Input1 = GUICtrlCreateInput("Input1", 24, 136, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GUIGetMsg()
if $msg=-3 then Exit
if $msg=$button1 then button1()
if $msg=$button2 then button2()
WEnd
Func button1()
GUICtrlSetData($Output1,guictrlread($input1))
GUICtrlSetData($Output2,guictrlread($input1))
;~ $input1 = $input2
EndFunc
Func button2()
GUICtrlSetData($Output2,($input2))
EndFunc
Re: [R] Récupérer une variable.
Posté : ven. 06 mars 2015 18:57
par camil
C'est bon j'ai trouvé :
$input2 = GUICtrlRead($input1)
Re: [..] Récupérer une variable.
Posté : ven. 06 mars 2015 20:14
par blacksoul305
Bonsoir,
il faut éditer le titre du
premier message pour clore le sujet, merci
EDIT : mikell risque d'être tout vert s'il voit sa photo sur ton profil :O