Jump to content

ListView in list mode with grid?


mike2003
 Share

Recommended Posts

Is it possible to combine this?

5kskT34.jpg

like this

v86PmV5.jpg

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
    GUICreate("listview items", 220, 250, 100, 200, -1)
;~  Local $idListview = GUICtrlCreateListView("col1  |col2|col3  ", 10, 10, 200, 150, -1, $LVS_EX_GRIDLINES)
    Local $idListview = GUICtrlCreateListView("col1  |col2|col3  ", 10, 10, 200, 150, $LVS_LIST, $LVS_EX_GRIDLINES)
    Local $idItem1 = GUICtrlCreateListViewItem("item2|col22|col23", $idListview)
    Local $idItem2 = GUICtrlCreateListViewItem("item1|col12|col13", $idListview)
    Local $idItem3 = GUICtrlCreateListViewItem("item3|col32|col33", $idListview)
    GUISetState(@SW_SHOW)
    GUICtrlDelete($idItem1)
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>Example

 

Link to comment
Share on other sites

There's no need for the UDF, just use $LVS_Report instead of $LVS_List as style and Bitor($LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT) instead of $LVS_EX_GRIDLINES as exstyle:

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
    GUICreate("listview items", 220, 250, 100, 200, -1)
;~  Local $idListview = GUICtrlCreateListView("col1  |col2|col3  ", 10, 10, 200, 150, -1, $LVS_EX_GRIDLINES)
    Local $idListview = GUICtrlCreateListView("col1  |col2|col3  ", 10, 10, 200, 150,  $LVS_REPORT,Bitor($LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT))
    Local $idItem1 = GUICtrlCreateListViewItem("item2|col22|col23", $idListview)
    Local $idItem2 = GUICtrlCreateListViewItem("item1|col12|col13", $idListview)
    Local $idItem3 = GUICtrlCreateListViewItem("item3|col32|col33", $idListview)
    GUISetState(@SW_SHOW)
    GUICtrlDelete($idItem1)
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>Example

 

Link to comment
Share on other sites

  • 2 weeks 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

×
×
  • Create New...