SandelPerieanu Posted November 20, 2006 Share Posted November 20, 2006 i don't know how use $GUI_BKCOLOR_LV_ALTERNATE.please help me to understand this special flag. Link to comment Share on other sites More sharing options...
BigDod Posted November 20, 2006 Share Posted November 20, 2006 It is used in list views for colouring alternative lines differently.From the help fileThe special flag $GUI_BKCOLOR_LV_ALTERNATE can be used with Listview control to give alternate background of the ListviewItems lines.The odd lines will get the color set by GUICtrlSetBkColor of the Listview control.The even lines will get the color set by GUICtrlSetBkColor of the ListviewItem control. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
SandelPerieanu Posted November 20, 2006 Author Share Posted November 20, 2006 give me an example.... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 20, 2006 Moderators Share Posted November 20, 2006 give me an example....I think you missed an operative word there ... My kids would run for cover if they ever said "give me".Why don't you provide a ListView to work with, and I'm sure someone can show you how to use it. (Or did you want them to "give" you that too?) 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 More sharing options...
user52 Posted January 12, 2007 Share Posted January 12, 2007 $bl = GUICtrlCreateListViewItem("B|L|U|E||", $List1) ; <-------- Changed GUICtrlSetBkColor($bl, "0x00000FF") ^works too Link to comment Share on other sites More sharing options...
djek Posted January 18, 2007 Share Posted January 18, 2007 give me an example.... The word you are looking for is 'please' an example #include <GUIConstants.au3> #include <GuiListView.au3> ;create form ;whlt $Form1 = GUICreate("AForm1", 370, 270, 193, 115) ;create listview ;ltwh $ListView1 = GUICtrlCreateListView("000000|111111|222222222222222", 10, 10, 350, 250) ;set to alternate the colors GUICtrlSetBkColor($ListView1, $GUI_BKCOLOR_LV_ALTERNATE) ;insert item $ListView1_0 = GUICtrlCreateListViewItem("aaa|111|nononono", $ListView1) ;set alternate color GUICtrlSetBkColor(-1, 0xffff00) $ListView1_1 = GUICtrlCreateListViewItem("bbb|222|yes", $ListView1) ;set alternate color GUICtrlSetBkColor(-1, 0xffff00) $ListView1_2 = GUICtrlCreateListViewItem("ccc|333|nononono", $ListView1) ;set alternate color GUICtrlSetBkColor(-1, 0xffff00) ;resize the columns to header _GUICtrlListViewSetColumnWidth ($listview1, 0, $LVSCW_AUTOSIZE_USEHEADER) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd It took me a while to figure it out too. Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 18, 2007 Share Posted January 18, 2007 Hi, and which way do you set the selected line? Lets say, I will read the input with GuiCtrlread ... and will select the line entered. How will I do that? :"> #include <GUIConstants.au3> #include <GuiListView.au3> GUICreate("listview items", 220, 250, 100, 200, -1) GUISetBkColor(0x00E0FFFF) ; will change background color $listview = GUICtrlCreateListView("Name |Vorname |Alter ", 10, 10, 200, 150, Default,$LVS_EX_GRIDLINES + $LVS_EX_FULLROWSELECT);,$LVS_SORTDESCENDING) _GUICtrlListViewSetColumnWidth($listview, 2, $LVSCW_AUTOSIZE_USEHEADER) $button = GUICtrlCreateButton("OK", 75, 170, 70, 20) $item1 = GUICtrlCreateListViewItem("Mega|Thorsten|27", $listview) $item2 = GUICtrlCreateListViewItem("Blome|Dennis|26", $listview) $item3 = GUICtrlCreateListViewItem("Schaefer|Rene|26", $listview) $input1 = GUICtrlCreateInput("", 20, 200, 150) GUISetState() While 1 Switch GUIGetMsg() Case $GUi_Event_Close Exit (0) Case $button ;GUICtrlSetState($item2, $GUI_Focus) ;_GUICtrlListViewSetItemSelState ($listview, 1,1,1) Case $listview MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2) EndSwitch WEnd So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
c.haslam Posted July 16, 2011 Share Posted July 16, 2011 In its simplest form, it might look like: #include <GUIConstantsEx.au3> #include <GuiListView.au3> GUICreate("AForm1", 370, 270, 193, 115) $ListView1 = GUICtrlCreateListView("Name|Age|Sex", 10, 10, 350, 250) GUICtrlSetBkColor($ListView1, $GUI_BKCOLOR_LV_ALTERNATE) GUICtrlCreateListViewItem("Joe|26|Male", $ListView1) GUICtrlCreateListViewItem("Mary|48|Female", $ListView1) GUICtrlSetBkColor(-1, 0xf3f389) GUICtrlCreateListViewItem("Jack|6|Male", $ListView1) GUICtrlCreateListViewItem("Kittie|99|Female", $ListView1) GUICtrlSetBkColor(-1, 0xf3f389) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd A GUICtrlSetBkColor call seems to be required for every row to be colored differently from white. Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard 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