Belini Posted March 30, 2012 Share Posted March 30, 2012 (edited) putting different colors in listview: expandcollapse popup#include <GuiConstants.au3> #include <GuiListView.au3> ; ====================================== ; AutoIt3 V 3.3.9.2 ; Author: Belini ; Date: 03.30.2012 ; Objective: Highlight rows in listview ; ====================================== $GUI = GUICreate("Listview_Colors", 200, 116, -1, -1) $hListView = GUICtrlCreateListView("", 1, 1, 398, 298, bitor($LVS_NOCOLUMNHEADER, $LVS_NOSCROLL), $LVS_EX_GRIDLINES) _GUICtrlListView_AddColumn($hListView, "Músicas do cd", 100) _GUICtrlListView_AddColumn($hListView, "endereço", 200) GUICtrlSetFont($hListView, 9, 400, 2, "arial") GUICtrlSetBkColor($hListView, 0x233BF7) GUICtrlSetColor($hListView, 0xFFFFFF) GUICtrlCreateListViewItem("test 1", $hListView) _GUICtrlListView_AddSubItem($hListView, 0, "test 1", 1) GUICtrlSetBkColor(-1, 0xF25AF0) GUICtrlCreateListViewItem("test 2", $hListView) _GUICtrlListView_AddSubItem($hListView, 1, "test 2", 1) GUICtrlSetBkColor(-1, 0x0FA327) GUICtrlCreateListViewItem("test 3", $hListView) _GUICtrlListView_AddSubItem($hListView, 2, "test 3", 1) GUICtrlSetBkColor(-1, 0xF57E07) GUICtrlCreateListViewItem("test 4", $hListView) _GUICtrlListView_AddSubItem($hListView, 3, "test 4", 1) GUICtrlSetBkColor(-1, 0xD1152E) GUICtrlCreateListViewItem("test 5", $hListView) _GUICtrlListView_AddSubItem($hListView, 4, "test 5", 1) GUICtrlSetBkColor(-1, 0xF25AF0) GUICtrlCreateListViewItem("test 6", $hListView) _GUICtrlListView_AddSubItem($hListView, 5, "test 6", 1) GUICtrlCreateListViewItem("test 7", $hListView) GUICtrlSetBkColor(-1, 0x1C0CF7) _GUICtrlListView_AddSubItem($hListView, 6, "test 7", 1) GUICtrlSetBkColor(-1, 0x1F5C05) GUISetState(@SW_SHOW, $GUI) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() Edited March 30, 2012 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Skitty Posted March 30, 2012 Share Posted March 30, 2012 Anyway to get a list view like this? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 30, 2012 Moderators Share Posted March 30, 2012 ApudAngelorum,That is a TreeView. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Belini Posted March 30, 2012 Author Share Posted March 30, 2012 @ApudAngelorum, the idea here is to color the lines My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Skitty Posted March 30, 2012 Share Posted March 30, 2012 ApudAngelorum,That is a TreeView. M23Hmm, I've always assumed that it was a list view since it has the ability to display list view style extras info like this.How do I get a tree view control to display things like the above?Maybe I'll take this to help section.. Link to comment Share on other sites More sharing options...
DW1 Posted March 30, 2012 Share Posted March 30, 2012 It's not a tree view or a list view, it's a combo of both.Check out more information on process explorer's TreeListView here. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
LarsJ Posted March 30, 2012 Share Posted March 30, 2012 If you want colors in ListViews (or TreeViews) then take a look at this one:http://www.autoitscript.com/forum/index.php?showtopic=138250 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Skitty Posted March 30, 2012 Share Posted March 30, 2012 It's not a tree view or a list view, it's a combo of both.Check out more information on process explorer's TreeListView here.Thanks, but now that I dove into this I realize why there are no examples in autoit for this, it's a little complicated (or a lot). If you want colors in ListViews (or TreeViews) then take a look at this one:http://www.autoitscript.com/forum/index.php?showtopic=138250Adding colors, fonts, icons, images and what not is easy because there are native autoit functions intended for doing this and APIs like OPs example, it's just that I was curious because at first sight I thought OP was doing something along the lines of like what I asked, but then I realized it was just colorizing entries using native autoit functions, I don't know why I was so compulsive when I posted this , It's just that I've been getting desperate that's all.. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now