Page 1 sur 1
[R] Défilement horizontal et vertical
Posté : lun. 08 juin 2009 13:24
par ethneldryt
Bonjour, voila le code :
► Afficher le texte
Code : Tout sélectionner
$gui = GUICreate("test",676,470)
GUISetBkColor(0x767676)
GUICtrlCreateTab(103,94,269,339)
GUICtrlCreateTabItem("tab1")
GUICtrlCreateTabItem("tab2")
GUICtrlCreateGroup("",110,115,254,80)
GUICtrlCreateGroup("",110,195,254,230)
startuphklm()
GUICtrlCreateTabItem("tab3")
GUICtrlCreateTabItem("")
GUISetState()
while 1
sleep(100)
WEnd
func startuphklm()
$poschk = 205
$rchk = 225
For $i= 1 to 100
$var = RegEnumVal("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $i)
$var2 = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",$var)
If @error <> 0 then ExitLoop
$chkk = GUICtrlCreateCheckbox($var,115,$poschk)
GUICtrlCreateLabel("id:" & $chkk & " Emplacement : " & $var2,115,$rchk)
$poschk = $poschk + 40
$rchk = $rchk + 40
Next
EndFunc
je voudrais savoir si il est possible dans la tab 2, mettre des barre de défilement pour éviter que les écriture dépasse en hauteur et largeur. Merci.
J'ai une autre question, quand on clique sur les barre "tab1","tab2" ou "tab3"
est t'il possible de détecter quel bouton de tab a été cliquer et ouvert?
Re: [..] Défilement horizontal et vertical
Posté : lun. 08 juin 2009 17:00
par jumby
Voici une possibilité en bidouillant, mais le résultat est très laid.
► Afficher le texte
Code : Tout sélectionner
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <UpdownConstants.au3>
#include <UpdownConstants.au3>
Global $Updown1
$valueupdown1 = 0
$gui = GUICreate("test",676,470)
GUISetBkColor(0x767676)
GUICtrlCreateTab(103,94,269,339)
GUICtrlCreateTabItem("tab1")
GUICtrlCreateTabItem("tab2")
GUICtrlCreateGroup("",110,115,254,80)
GUICtrlCreateGroup("",110,195,254,230)
$Input1 = GUICtrlCreateInput("0", 0, 0)
GUICtrlSetState(-1, $GUI_HIDE)
$Updown1 = GUICtrlCreateUpdown($Input1, BitOR($UDS_WRAP,$UDS_HORZ))
GUICtrlSetPos($Updown1, 103,420, 270, 15)
startuphklm()
GUICtrlCreateTabItem("tab3")
GUICtrlCreateTabItem("")
GUISetState()
func startuphklm()
$poschk = 205
$rchk = 225
For $i= 1 to 100
$var = RegEnumVal("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $i)
$var2 = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",$var)
If @error <> 0 then ExitLoop
$chkk = GUICtrlCreateCheckbox($var,115,$poschk)
GUICtrlSetBkColor(-1, 0xffffff)
$id = "id:" & $chkk & " Emplacement : " & $var2
$extractchar = StringMid($id, 1+$valueUpdown1, 43)
$aa = GUICtrlCreateLabel($extractchar, 115, $rchk)
GUICtrlSetBkColor(-1, 0xffffff)
$poschk = $poschk + 40
$rchk = $rchk + 40
Next
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Updown1
$valueUpdown1 = GUICtrlRead($Input1)
if $valueUpdown1 < 0 Then
$valueUpdown1 = 0
EndIf
call("startuphklm")
EndSwitch
WEnd
Re: [..] Défilement horizontal et vertical
Posté : lun. 08 juin 2009 17:05
par jbnh
Avec un édit qui a comme style $WS_VSCROLL et $WS_HSCROLL