J'aimerai beaucoup savoir composer, sur ma GUI, un bouton,
dont le texte et l'action s'inverse, à chaque fois que l'on clique dessus.
Je n'ai aucune idée sur la bonne manière de m'y prendre
(cacher, supprimer,remplacer du texte....????)
Voici une partie de mon code concerné!
► Afficher le texte
ATTENTION, IL CONTIENT BEAUCOUP DE FAUTES!
Func AfficherInterface()
_IEErrorHandlerRegister()
$oIE = _IECreateEmbedded()
$GuiApropos = GUICreate("", 1280, 960, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$GUIActiveX = GUICtrlCreateObj($oIE, 5, 5, 1160, 960)
$BoutonAlterne = GUICtrlCreateButton($LibelleBouton, 1165, 55, 100, 50)
If StringLen($Choix1)>0 Then
_IENavigate($oIE, "http://msn.fr" )
_IENavigate($oIE, http://www.google.fr)
$LibelleBouton = ">>CHOIX2>>"
;On modifie l'affichage du bouton de l'interface
$Enchainer = GUICtrlCreateButton($LibelleBouton, 1165, 55, 100, 50)
Else
_IENavigate($oIE, $Choix2)
$LibelleBouton = ">>CHOIX1>>";Le changement se verra après(???)
;On modifie l'affichage du bouton de l'interface
$Enchainer = GUICtrlCreateButton($LibelleBouton, 1165, 55, 100, 50)
EndIf
;_IEBodyWriteHTML($oIE, $sHTML)
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $Enchainer
;on repropose la routine complète: réglage de l'url
If $LibelleBouton = ">>CHOIX1>>" Then
$TheOtherUrl= StringReplace($TheOtherUrl,"http://www.google.fr","http://msn.fr"
_IENavigate($oIE, $TheOtherUrl);Par cette méthode, je tombe toujours juste sur le premier bouton!
$LibelleBouton = ">>CHOIX2>>"
;On modifie l'affichage du bouton de l'interface
$Enchainer = GUICtrlCreateButton($LibelleBouton, 1165, 55, 100, 50)
EndIf
If $LibelleBouton = ">>CHOIX N°1>>" Then
$TheOtherUrl= StringReplace($TheOtherUrl,"etat_2.asp?sel=OM&dossier=","etat_1.asp?sel=OM&dossier=")
_IENavigate($oIE, $TheOtherUrl);Par cette méthode, je tombe toujours juste sur le premier bouton!(???) $LibelleBouton = ">>CHOIX N°2>>"
;On modifie l'affichage du bouton de l'interface
$Enchainer = GUICtrlCreateButton($LibelleBouton, 1165, 55, 100, 50)
EndIf
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
WEnd
GUIDelete($GuiApropos)
EndFunc ;==>_Apropos
Func AfficherInterface()
_IEErrorHandlerRegister()
$oIE = _IECreateEmbedded()
$GuiApropos = GUICreate("", 1280, 960, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$GUIActiveX = GUICtrlCreateObj($oIE, 5, 5, 1160, 960)
$BoutonAlterne = GUICtrlCreateButton($LibelleBouton, 1165, 55, 100, 50)
If StringLen($Choix1)>0 Then
_IENavigate($oIE, "http://msn.fr" )
_IENavigate($oIE, http://www.google.fr)
$LibelleBouton = ">>CHOIX2>>"
;On modifie l'affichage du bouton de l'interface
$Enchainer = GUICtrlCreateButton($LibelleBouton, 1165, 55, 100, 50)
Else
_IENavigate($oIE, $Choix2)
$LibelleBouton = ">>CHOIX1>>";Le changement se verra après(???)
;On modifie l'affichage du bouton de l'interface
$Enchainer = GUICtrlCreateButton($LibelleBouton, 1165, 55, 100, 50)
EndIf
;_IEBodyWriteHTML($oIE, $sHTML)
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $Enchainer
;on repropose la routine complète: réglage de l'url
If $LibelleBouton = ">>CHOIX1>>" Then
$TheOtherUrl= StringReplace($TheOtherUrl,"http://www.google.fr","http://msn.fr"
_IENavigate($oIE, $TheOtherUrl);Par cette méthode, je tombe toujours juste sur le premier bouton!
$LibelleBouton = ">>CHOIX2>>"
;On modifie l'affichage du bouton de l'interface
$Enchainer = GUICtrlCreateButton($LibelleBouton, 1165, 55, 100, 50)
EndIf
If $LibelleBouton = ">>CHOIX N°1>>" Then
$TheOtherUrl= StringReplace($TheOtherUrl,"etat_2.asp?sel=OM&dossier=","etat_1.asp?sel=OM&dossier=")
_IENavigate($oIE, $TheOtherUrl);Par cette méthode, je tombe toujours juste sur le premier bouton!(???) $LibelleBouton = ">>CHOIX N°2>>"
;On modifie l'affichage du bouton de l'interface
$Enchainer = GUICtrlCreateButton($LibelleBouton, 1165, 55, 100, 50)
EndIf
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
WEnd
GUIDelete($GuiApropos)
EndFunc ;==>_Apropos




