Jump to content

GUICtrlCreateGroup() $WS_VSCROLL


Recommended Posts

the scroll is not working

#RequireAdmin
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
Opt("WinTitleMatchMode", 2)
GUICreate("Window mngr",300,180)
$winname=GUICtrlCreateInput("",10,10,140)
$kill=GUICtrlCreateRadio("Kill",10,30)
$minimize=GUICtrlCreateRadio("minimize",10,50)
$hide=GUICtrlCreateRadio("hide",10,70)
$show=GUICtrlCreateRadio("show",10,90)
$rename=GUICtrlCreateRadio("rename",10,110)
$ref=GUICtrlCreateButton("Refresh",10,130,50)
$aply=GUICtrlCreateButton("Apply",80,130,50)
$g=GUICtrlCreateGroup("Clients",160,10,130,30+(20*0))
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState()
WinSetOnTop("Window mngr","",1)
Dim $clients[1][2]
$clients[0][0]=0
Dim $x[$clients[0][0]+1]
do
    $msg = GUIGetMsg()
    Select 
    Case $msg = $ref
        $i=1
        If $clients[0][0] <> 0 Then
            While 1
                GUICtrlDelete ($x[$i])
                $i=$i+1
                If $i > $clients[0][0] Then
                    ExitLoop
                EndIf
            WEnd
        EndIf
        $clients=WinList()
        If $clients[0][0] <> 0 Then
            GUICtrlDelete($g)
            Dim $x[$clients[0][0]+1]
            $i=1
            $g=GUICtrlCreateGroup("Clients",160,10,130,30+(20*$clients[0][0]),$WS_VSCROLL)
            While 1
                $x[$i]=GUICtrlCreateCheckbox($clients[$i][0],170,30+(($i-1)*20))
                $i=$i+1
                If $i > $clients[0][0] Then
                    ExitLoop
                EndIf
            WEnd
            GUICtrlCreateGroup("", -99, -99, 1, 1)
            $nomc=$i
        EndIf
    EndSelect
Until $msg=$GUI_EVENT_CLOSE
Link to comment
Share on other sites

well the "TreeView" did the trick :idea:

#RequireAdmin
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <TreeviewConstants.au3>
Opt("WinTitleMatchMode", 2)
$p=GUICreate("Window mngr",400,180)
$winname=GUICtrlCreateInput("",10,10,140)
$kill=GUICtrlCreateRadio("Kill",10,30)
$minimize=GUICtrlCreateRadio("minimize",10,50)
$hide=GUICtrlCreateRadio("hide",10,70)
$show=GUICtrlCreateRadio("show",10,90)
$rename=GUICtrlCreateRadio("rename",10,110)
$ref=GUICtrlCreateButton("Refresh",10,130,50)
$aply=GUICtrlCreateButton("Apply",80,130,50)
$g=GUICtrlCreateGroup("Clients",160,10,200,30+(20*6))
$tg=GUICtrlCreateTreeView(170,30,180,120,$TVS_CHECKBOXES)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState()
WinSetOnTop("Window mngr","",1)
Dim $clients[1][2]
$clients[0][0]=0
Dim $x[$clients[0][0]+1]
do
    $msg = GUIGetMsg()
    Select 
    Case $msg = $ref
        GUICtrlDelete($g)
        GUICtrlDelete($tg)
        $clients=WinList();
        If $clients[0][0] <> 0 Then
            Dim $x[$clients[0][0]+1]
            $i=1
            $g=GUICtrlCreateGroup("Clients",160,10,200,30+(20*6))
            $tg=GUICtrlCreateTreeView(170,30,180,120,$TVS_CHECKBOXES)
            While 1
                If $clients[$i][0] = "" Then
                    $i=$i+1
                    If $i > $clients[0][0] Then
                        ExitLoop
                    EndIf
                Else
                    $x[$i]=GuiCtrlCreateTreeViewItem($clients[$i][0],$tg)
                    $i=$i+1
                    If $i > $clients[0][0] Then
                        ExitLoop
                    EndIf
                EndIf
            WEnd
            GUICtrlCreateGroup("", -99, -99, 1, 1)
            $nomc=$i
        Else
            $g=GUICtrlCreateGroup("Clients",160,10,200,30+(20*6))
            $tg=GUICtrlCreateTreeView(170,30,180,120,$TVS_CHECKBOXES)
            GUICtrlCreateGroup("", -99, -99, 1, 1)
        EndIf
    EndSelect
Until $msg=$GUI_EVENT_CLOSE
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...