tout nouveau sur le forum je vous sollicite déjà !
J'essaye de me faire un outil pour mon travail, mais je bloque sur une étape et j'aurais donc besoin de lumière
Avec ce programme j'inscris dans un fichier .ini des infos que calcule le programme.
Exemple :
Code : Tout sélectionner
[CB534]
Type=CB534
Marque=Caterpillar
Masse=8500
Largeur=190
A1=1.2
A2=2.2
A1=V4
A2=V5
[CC722]
Type=CC722
Marque=Dynapac
Masse=11800
Largeur=213
A1=1.5
A2=2.4
A1=V5
A2=V5
[BW216]
Type=BW216
Marque=Bomag
Masse=11250
Largeur=213
A1=1.2
A2=2.6
A1=V4
A2=V5
tout ce retrouve sur la colonne 1 !
Je m'y prend surement mal.
Merci pour votre aide.
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
Global $File = @HomeDrive & "\Users\Tespark\Desktop\config.ini"
$Form1 = GUICreate("Form1", 615, 352, 192, 124)
$ListView1 = GUICtrlCreateListView("Type|Marque|Masse|Largeur|A1|A2", 0, 40, 600, 300)
$Input1 = GUICtrlCreateInput("", 200, 8, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER))
$Button1 = GUICtrlCreateButton("Search", 409, 8, 111, 21)
GUISetState(@SW_SHOW)
$readsectionnames = IniReadSectionNames($File)
For $i = 1 To $readsectionnames[0]
$readType = IniRead($File, $readsectionnames[$i], "Type", "")
GUICtrlCreateListViewItem($readType, $ListView1)
Next
; ICI JE DOIS PAS FAIRE CE QU'IL FAUT
For $i = 1 To $readsectionnames[0]
$readMarque = IniRead($File, $readsectionnames[$i], "Marque", "")
GUICtrlCreateListViewItem($readMarque, $ListView1)
Next
; ECT... POUR NOTER TOUTES LES INFOS DU FICHIER .INI ► Type, Marque, Masse, Largeur, A1, A2, A1, A2
_GUICtrlListView_SetColumnWidth($ListView1, 0, 150)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$Search = _GUICtrlListView_FindText($ListView1, GUICtrlRead($Input1))
_GUICtrlListView_SetItemSelected($ListView1, $Search)
_GUICtrlListView_EnsureVisible($ListView1, $Search)
EndSwitch
WEnd
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
Global $File = @HomeDrive & "\Users\Tespark\Desktop\config.ini"
$Form1 = GUICreate("Form1", 615, 352, 192, 124)
$ListView1 = GUICtrlCreateListView("Type|Marque|Masse|Largeur|A1|A2", 0, 40, 600, 300)
$Input1 = GUICtrlCreateInput("", 200, 8, 177, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER))
$Button1 = GUICtrlCreateButton("Search", 409, 8, 111, 21)
GUISetState(@SW_SHOW)
$readsectionnames = IniReadSectionNames($File)
For $i = 1 To $readsectionnames[0]
$readType = IniRead($File, $readsectionnames[$i], "Type", "")
GUICtrlCreateListViewItem($readType, $ListView1)
Next
; ICI JE DOIS PAS FAIRE CE QU'IL FAUT
For $i = 1 To $readsectionnames[0]
$readMarque = IniRead($File, $readsectionnames[$i], "Marque", "")
GUICtrlCreateListViewItem($readMarque, $ListView1)
Next
; ECT... POUR NOTER TOUTES LES INFOS DU FICHIER .INI ► Type, Marque, Masse, Largeur, A1, A2, A1, A2
_GUICtrlListView_SetColumnWidth($ListView1, 0, 150)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$Search = _GUICtrlListView_FindText($ListView1, GUICtrlRead($Input1))
_GUICtrlListView_SetItemSelected($ListView1, $Search)
_GUICtrlListView_EnsureVisible($ListView1, $Search)
EndSwitch
WEnd