Pour exécuter le script, mettre 5 images (environ 373 X 250 pixel) en jpg dans le dossier c:\Temp
En passant, désolé pour le poste au mauvais endroit ... C'est mes premiers pas dans un forum.
En espérant que tout est maintenant conforme au règle du forum
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>
Opt("GUIOnEventMode", 1)
Global $data1, $aff
Global $hTab, $Gui2
#Region ### START Koda GUI section ### Form=
$Gui1 = GUICreate("Choices Dialog", 300, 250, 302, 218)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form2Close")
$ListBox1 = GUICtrlCreateList("", 8, 8, 137, 201)
GUICtrlSetData(-1, "Item1|Item2|Item3|Item4|Item5")
$Label1 = GUICtrlCreateLabel("Label1", 16, 224, 100, 20)
$ButtonTab = GUICtrlCreateButton("Tab", 180, 20, 50, 50)
GUICtrlSetOnEvent(-1, "ButtonClick")
GUISetState(@SW_SHOW, $Gui1)
; Create GUI
$Gui2 = GUICreate("Spécimens en comparaison", 400, 300)
$hTab = GUICtrlCreateTab(2, 2, 396, 296)
GUISetOnEvent($GUI_EVENT_CLOSE, "FormClose")
GUISetState(@SW_HIDE, $Gui2)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
GUICtrlSetData($Label1,"Contient " & _GUICtrlListBox_GetCount($ListBox1) & " items")
WEnd
Func ButtonClick()
$aI = _GUICtrlListBox_GetCount($ListBox1)
For $iI = 1 To $aI
_GUICtrlListBox_ClickItem($ListBox1, $iI)
$data1 = GUICtrlRead($ListBox1)
_GUICtrlTab_InsertItem($hTab, $iI, $data1)
GUICtrlCreatePic("C:\TEMP\" & $data1 & ".jpg", 20, 40, 373, 250)
;MsgBox(0,"OK",$data1)
Next
GUISetState(@SW_SHOW, $Gui2)
EndFunc
Func Form2Close()
_GUICtrlListBox_EndUpdate($ListBox1)
exit
EndFunc
Func FormClose()
GUISwitch($Gui1)
GUISetState(@SW_HIDE, $Gui2)
_GUICtrlTab_DeleteAllItems($hTab)
EndFunc

