Jump to content
mnaboud76

listview

Recommended Posts

mnaboud76

how I can macke subitem belong to Item in listview and I need appear or disappear this subitem.

thank you

002.jpg

Share this post


Link to post
Share on other sites
careca

When i think about a subitem, i think about the item in the columns to the right.

So for me, what you're saying is that you need to be able to hide / show the columns to the right of the first item.

Is that what you mean? If it is, im not sure i can help.


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
mnaboud76

I need to be able to hise / show this 2 Rows (item 4.1 and item 4.2) when i click of arrow

and the information in this 2 rows belongs to item 4

Share this post


Link to post
Share on other sites
JLogan3o13

First off, is this in a listview you have created, or an external application? If it is something you created, how about showing your code? If it is external, what is the app?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
mnaboud76
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <Array.au3>
#include <GuiListView.au3>
#include <WindowsConstants.au3>


Example()

Func Example()
    Local $listview, $button, $item1, $item2, $item3, $msg

    GUICreate("listview items", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES)
    GUISetBkColor(0x00E0FFFF) ; will change background color
   Local $aArray1[4][3]
   For $i = 0 To 3
      For $j = 0 to 2
         $aArray1[$i][$j] = ($i+1)+ ($j+1)
      Next
   Next
   _ArrayDisplay($aArray1 , "$aArray1")
    $idListviewP = GUICtrlCreateListView("", 10, 10, 200, 150,-1, $WS_EX_CLIENTEDGE)
    $button = GUICtrlCreateButton("Value?", 75, 170, 70, 20)

   
     _GUICtrlListView_InsertColumn($idListviewP, 0, "", 50)
     _GUICtrlListView_InsertColumn($idListviewP, 1, "Col1", 50)
     _GUICtrlListView_InsertColumn($idListviewP, 2, "Col2", 50)
     _GUICtrlListView_InsertColumn($idListviewP, 3, "Col3", 50)
   
   Local $ValueRow0 = "|" , $ValueRow1 = "|" , $ValueRow2 = "|" , $ValueRow3 = "|"
   For $i = 0 To 3
      For $j = 0 to 2
         if $i == 0 Then
            If $j < 2 Then
               $ValueRow0 &= $aArray1[$i][$j] & "|"
            Else
               $ValueRow0 &= $aArray1[$i][$j]
            EndIf
         EndIf
         if $i == 1 Then
            If $j < 2 Then
               $ValueRow1 &= $aArray1[$i][$j] & "|"
            Else
               $ValueRow1 &= $aArray1[$i][$j]
            EndIf
         EndIf
         if $i == 2 Then
            If $j < 2 Then
               $ValueRow2 &= $aArray1[$i][$j] & "|"
            Else
               $ValueRow2 &= $aArray1[$i][$j]
            EndIf
         EndIf
         if $i == 3 Then
            If $j < 2 Then
               $ValueRow3 &= $aArray1[$i][$j] & "|"
            Else
               $ValueRow3 &= $aArray1[$i][$j]
            EndIf
         EndIf
        
      Next
   Next
   
    $item1 = GUICtrlCreateListViewItem($ValueRow0, $idListviewP)
    $item2 = GUICtrlCreateListViewItem($ValueRow1, $idListviewP)
    $item3 = GUICtrlCreateListViewItem($ValueRow2, $idListviewP)
    $item4 = GUICtrlCreateListViewItem($ValueRow3, $idListviewP)
    $item41 = _GUICtrlListView_AddSubItem($idListviewP, 1, $ValueRow0, 1, 1)   ;
    $item42 = _GUICtrlListView_AddSubItem($idListviewP, 1, $ValueRow3, 2, 2)     ;


     GUICtrlSetState($item2, 0x00000020)    


    $item5 = GUICtrlCreateListViewItem($ValueRow0, $idListviewP)
    $item6 = GUICtrlCreateListViewItem($ValueRow1, $idListviewP)
    $item7 = GUICtrlCreateListViewItem($ValueRow2, $idListviewP)
    $item8 = GUICtrlCreateListViewItem($ValueRow3, $idListviewP)
    

    GUICtrlCreateInput("", 20, 200, 150)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)
    GUISetState(@SW_SHOW)
    
   Do
        $msg = GUIGetMsg()

        Select
            Case $msg = $button
                MsgBox($MB_SYSTEMMODAL, "listview item", GUICtrlRead(GUICtrlRead($idListviewP)), 2)
            ;Case $msg = $listview
                ;MsgBox($MB_SYSTEMMODAL, "listview", "clicked=" & GUICtrlGetState($idListviewP), 2)
        EndSelect
    Until $msg = $GUI_EVENT_CLOSE
    
EndFunc ;==>Example

 

Edited by Melba23
Added code tags

Share this post


Link to post
Share on other sites
Melba23

mnaboud76,

How about using groups within the ListView:

#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>

Example()

Func Example()
    Local $aInfo, $hImage, $idListview

    GUICreate("ListView Set Group Info", 400, 300)

    $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
    GUISetState(@SW_SHOW)

    ; Add columns
    _GUICtrlListView_AddColumn($idListview, "Column 1", 100)
    _GUICtrlListView_AddColumn($idListview, "Column 2", 100)
    _GUICtrlListView_AddColumn($idListview, "Column 3", 100)

    ; Add items
    _GUICtrlListView_AddItem($idListview, "Row 1: Col 1", 0)
    _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 2", 1)
    _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 3", 2)
    _GUICtrlListView_AddItem($idListview, "Row 2: Col 1", 1)
    _GUICtrlListView_AddSubItem($idListview, 1, "Row 2: Col 2", 1)
    _GUICtrlListView_AddItem($idListview, "Row 3: Col 1", 2)

    ; Build groups
    _GUICtrlListView_EnableGroupView($idListview)
    _GUICtrlListView_InsertGroup($idListview, -1, 1, "Group 1")
    _GUICtrlListView_InsertGroup($idListview, -1, 2, "Group 2")
    _GUICtrlListView_SetItemGroupID($idListview, 0, 1)
    _GUICtrlListView_SetItemGroupID($idListview, 1, 2)
    _GUICtrlListView_SetItemGroupID($idListview, 2, 2)

    _GUICtrlListView_SetGroupInfo($idListview, 2, "Group 2", 0, $LVGS_COLLAPSIBLE)

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    GUIDelete()
EndFunc   ;==>Example

As you can see, group 2 can be expanded and collapsed as required.

M23

  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
mnaboud76

thank you very much  for all and every things is OK now

thanks

Melba23

 

Share this post


Link to post
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

×