Mais voila mon problème :
a lieu de faire plusieurs fenêtre avec des information différente je voudrais une fenetre et que seul les information change dedans
ex: ma fentre contient bonjour et un bouton (ok) et lorsque que j'appuis sur le bouton bonjour et le boutton disparaisse pour laisse place a autre chose.
je sais pas si j 'ai réussi ma faire comprendre ^^..
j'ai un autre problème quand jutilise (GUICtrlRead(23) ) l'ID et 23 puis je fais un call a la fenction precedent mais lID change que faire plus de détaille dans le script.
merci d avance
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $score = 0
#Region ### START Koda GUI section ### Form=c:\users\vivier\documents\edit script\math.kxf
$Form1_1 = GUICreate("Avenir", 625, 448, 284, 141)
GUISetIcon("C:\Users\VIVIER\Pictures\icon programation\program math.ico")
GUISetFont(15, 800, 0, "Palatino Linotype")
GUISetBkColor(0xF8B823)
$Label1 = GUICtrlCreateLabel("Avenir", 152, 72, 304, 137, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_RIGHTJUST))
GUICtrlSetFont(-1, 75, 800, 2, "Palatino Linotype")
GUICtrlSetColor(-1, 0xF0F0F0)
$Label2 = GUICtrlCreateLabel("Created by Quentin Vivier", 24, 392, 237, 31)
GUICtrlSetFont(-1, 15, 800, 6, "Palatino Linotype")
GUICtrlSetColor(-1, 0xFF0000)
$Label3 = GUICtrlCreateLabel("V 1.0.0", 568, 416, 37, 14)
GUICtrlSetFont(-1, 6, 800, 4, "MS Serif")
$start = GUICtrlCreateButton("Start", 240, 264, 121, 65, $WS_GROUP)
GUICtrlSetFont(-1, 15, 800, 2, "Palatino Linotype")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $start
GUISetState(@SW_HIDE)
Call( "choisir")
EndSwitch
WEnd
Func choisir()
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Tipe de calcul", 625, 443, 192, 124)
GUISetBkColor(0xF8B823)
$pose = GUICtrlCreateButton("Calcule pose", 24, 24, 273, 401, $WS_GROUP)
$tete = GUICtrlCreateButton("Calcul de tete", 320, 24, 273, 401, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $tete
GUISetState(@SW_HIDE)
Call("tete")
Case $pose
GUISetState(@SW_HIDE)
Call("calcule")
EndSwitch
WEnd
EndFunc
Func tete()
Global $plustete = GUICtrlCreateButton("+", 48, 56, 217, 121, $WS_GROUP)
#Region ### START Koda GUI section ### Form=
$autre = GUICreate("calcul de tete", 625, 443, 192, 124)
GUISetIcon("C:\Users\VIVIER\Pictures\icon programation\program math.ico")
GUISetBkColor(0xF8B823)
$Button6 = GUICtrlCreateButton("Revenir", 0, 0, 57, 41, $WS_GROUP)
$Button5 = GUICtrlCreateButton("-", 48, 264, 217, 121, $WS_GROUP)
GUICtrlSetFont(-1, 72, 800, 0, "MS Sans Serif")
Local $plustete = GUICtrlCreateButton("+", 48, 56, 217, 121, $WS_GROUP)
GUICtrlSetFont(-1, 64, 800, 0, "MS Sans Serif")
$Button3 = GUICtrlCreateButton("\", 352, 264, 217, 121, $WS_GROUP)
GUICtrlSetFont(-1, 64, 800, 0, "MS Sans Serif")
$Button4 = GUICtrlCreateButton("x", 352, 56, 217, 121, $WS_GROUP)
GUICtrlSetFont(-1, 64, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $plustete
GUISetState(@SW_HIDE)
Call ("adtete")
EndSwitch
WEnd
EndFunc
func calcule()
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Tipe de calcul", 625, 443, 192, 124)
GUISetIcon("C:\Users\VIVIER\Pictures\icon programation\program math.ico")
GUISetBkColor(0xF8B823)
$Button6 = GUICtrlCreateButton("Revenir", 0, 0, 57, 41, $WS_GROUP)
$Button5 = GUICtrlCreateButton("-", 48, 264, 217, 121, $WS_GROUP)
GUICtrlSetFont(-1, 72, 800, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton("+", 48, 56, 217, 121, $WS_GROUP)
GUICtrlSetFont(-1, 64, 800, 0, "MS Sans Serif")
$Button3 = GUICtrlCreateButton("\", 352, 264, 217, 121, $WS_GROUP)
GUICtrlSetFont(-1, 64, 800, 0, "MS Sans Serif")
$Button4 = GUICtrlCreateButton("x", 352, 56, 217, 121, $WS_GROUP)
GUICtrlSetFont(-1, 64, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func adtete()
$q1 = Random(1,12,1)
$q2 = Random(1,12,1)
$additon = Number ( $q1 + $q2 )
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Avenir", 625, 443, 192, 124)
GUISetBkColor(0xF8B823)
$revenir = GUICtrlCreateButton("Revenir", 0, 0, 89, 49, $WS_GROUP)
$Label3 = GUICtrlCreateLabel("+", 176, 200, 47, 91)
GUICtrlSetFont(-1, 54, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel($q2, 292, 193, 50, 104)
GUICtrlSetFont(-1, 64, 800, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel($q1, 72, 192, 50, 104)
GUICtrlSetFont(-1, 64, 800, 0, "MS Sans Serif")
$Label4 = GUICtrlCreateLabel("=", 368, 192, 50, 104)
GUICtrlSetFont(-1, 64, 800, 0, "MS Sans Serif")
$Suivant = GUICtrlCreateButton("Suivant", 496, 376, 113, 57, $WS_GROUP)
$Label7 = GUICtrlCreateLabel("\10", 312, 376, 50, 41)
GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif")
$Label6 = GUICtrlCreateLabel($score , 256, 376, 42, 49)
GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif")
$Input1 = GUICtrlCreateInput( "somme" , 448, 189, 89, 45)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Suivant
$recuper = GUICtrlRead(23);voila mon problem unr fois arriver je donne la bonne reponse donc il m ouvre une nouvelle fenetre et la il chang l ID de (GUICtrlCreateInput) voila et je voudrais aussi qu'a chaque il ne me recreer pas un fenêtre.
If ( $recuper = $additon ) Then
GUISetState(@SW_HIDE)
$score = $score + 1
Call ("adtete")
EndIf
If ( $recuper <> $additon ) Then
MsgBox(0,"","rater")
EndIf
EndSwitch
WEnd
EndFunc