Jump to content

Anyway to make a tree with listview item?


oren
 Share

Recommended Posts

There is always a way MUHAHAHAHAH

something like that :)

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Link to comment
Share on other sites

  • 1 month later...
  • Moderators

You'd be better off finding C++ or VB examples than C#/.NET.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Attached a workaround for combo + treeview

A treeview + listview workaround should also be possible.

Best regards, Reinhard

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;; combo with treeview workaround

$mainGUI = GuiCreate("Combo with Treeview WA",300,400,80,80)
    $inp1 = GuiCtrlCreateInput("General",20,40,162,20,$ES_READONLY)
        GUICtrlSetBkColor(-1,0xFFFFFF)
    GUISetFont (9, 400, 1,"Webdings");,$btn_inp1)
    $btn_inp1 = GuiCtrlCreateButton("6",179,40,19,19)
;GUISetFont (9, 400, 1,"Webdings",$btn_inp1)
GUISetState(@SW_SHOW) 

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $btn_inp1
            CbTreeView()

    EndSwitch
WEnd

func CBTreeView()
    $aWin = WingetPos($mainGUI)
    $aInpPos = ControlGetPos("","",$Inp1)
;msgbox(0,"",$aWin[0]&"/"&$aWin[1]&"/"&$aWin[2]&"/"&$aWin[3]&@crlf _
;           &$aInpPos[0]&"/"&$aInpPos[1]&"/"&$aInpPos[2]&"/"&$aInpPos[3])
    $xbL= $aWin[0]+$aInpPos[0]+4
    $xbT= $aWin[1]+$aInpPos[1]+30+20
    $boxGUI = GUICreate("Form1", 180,200,$xbL,$xbT, BitOR($WS_SYSMENU,$WS_POPUP,$WS_CLIPSIBLINGS), 0)
    $treeview = GUICtrlCreateTreeView(0,0,178,198)
        $generalitem    = GUICtrlCreateTreeViewitem("General", $treeview)
        GUICtrlSetColor(-1, 0x0000C0)
        $displayitem    = GUICtrlCreateTreeViewitem("Display", $treeview)
        GUICtrlSetColor(-1, 0x0000C0)
        $aboutitem    = GUICtrlCreateTreeViewitem("About", $generalitem)
        $compitem      = GUICtrlCreateTreeViewitem("Computer", $generalitem)
        $useritem      = GUICtrlCreateTreeViewitem("User", $generalitem)
        $resitem        = GUICtrlCreateTreeViewitem("Resolution", $displayitem)
        $otheritem    = GUICtrlCreateTreeViewitem("Other", $displayitem)
    GUISetState(@SW_SHOW)
    $aWinSave=$aWin

    While 1
        $nMsg2 = GUIGetMsg()
        $aWin = WingetPos($mainGUI)
        if $aWin[0] <> $aWinSave[0] then exitloop   
        Switch $nMsg2
            Case $GUI_EVENT_CLOSE
                Exitloop
            case $Generalitem
                    msgBox(0,"Choose", "Blue colored main items not choosable!"&@crlf _ 
                        &"Please choose a subitem or call your sevicedesk.")
            case $displayitem
                    msgBox(0,"Choose", "Blue colored main items not choosable!"&@crlf _ 
                        &"Please choose a subitem or call your servicedesk.")
            case $aboutItem
                $tvText = GUICtrlRead(GUICtrlRead($treeview),1)
                GUICTRLSetData($inp1,$tvText)
                ExitLoop
            case $compItem
                $tvText = GUICtrlRead(GUICtrlRead($treeview),1)
                GUICTRLSetData($inp1,$tvText)
                ExitLoop
            case $useritem
                $tvText = GUICtrlRead(GUICtrlRead($treeview),1)
                GUICTRLSetData($inp1,$tvText)
                ExitLoop
            case $resitem
                $tvText = GUICtrlRead(GUICtrlRead($treeview),1)
                GUICTRLSetData($inp1,$tvText)
                ExitLoop
            case $otheritem
                $tvText = GUICtrlRead(GUICtrlRead($treeview),1)
                GUICTRLSetData($inp1,$tvText)
                ExitLoop
            Case $btn_inp1
                Exitloop
        EndSwitch
        $aWinSave=$aWin
    WEnd
    GUIDelete($boxGUI)
endfunc
Link to comment
Share on other sites

  • 1 year later...

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...