EKY32 Posted October 1, 2012 Share Posted October 1, 2012 (edited) Is it available to hide a GuiCtrlCreateListView Borders?I hope so Thank you. Edited October 3, 2012 by EKY32 [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font] Link to comment Share on other sites More sharing options...
Danyfirex Posted October 1, 2012 Share Posted October 1, 2012 Look this example: expandcollapse popup; My example Gui #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListviewConstants.au3> #include <GuiListView.au3> Global Const $COLOR_GUI = 0x494E49 Global Const $COLOR_TEXT = 0xE6ECE0 $GUI = GUICreate('test', 300, 500, -1, -1) GUISetBkColor($COLOR_GUI) ; ======================= ListView 1 ; everything works, except: ; how can I remove the border (or change it's color) $listview = GUICtrlCreateListView("col1|col2|col3", 10, 10, 280, 200, $LVS_NOCOLUMNHEADER) GUICtrlSetBkColor(-1, $COLOR_GUI) GUICtrlSetColor(-1, $COLOR_TEXT) $item1 = GUICtrlCreateListViewItem("test|col22|col23", $listview) $item2 = GUICtrlCreateListViewItem("item1|col12|col13", $listview) $item3 = GUICtrlCreateListViewItem("item3|col32|col33", $listview) _GUICtrlListView_SetColumnWidth($listview, 0, 90) _GUICtrlListView_SetColumnWidth($listview, 1, 90) ; ======================= ListView 2 ; You needed to add a few styles <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $hListView = _GUICtrlListView_Create($GUI, "", 10, 220, 280, 200, BitOr($LVS_REPORT,$LVS_NOCOLUMNHEADER)) _GUICtrlListView_SetExtendedListViewStyle($hListView, $LVS_EX_FULLROWSELECT) _GUICtrlListView_SetBkColor($hListView, $COLOR_GUI) _GUICtrlListView_SetTextBkColor($hListView, $COLOR_GUI) _GUICtrlListView_SetTextColor($hListView, $COLOR_TEXT) _GUICtrlListView_AddColumn($hListView, "Col 1", 90) _GUICtrlListView_AddColumn($hListView, "Col 2", 90) _GUICtrlListView_AddColumn($hListView, "Col 3", 90) _GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1, 1) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2, 2) _GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1, 2) _GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2) GUISetState(@SW_SHOW) While 1 $eMSG = GUIGetMsg() Switch $eMSG Case -3 Exit EndSwitch WEnd Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
EKY32 Posted October 3, 2012 Author Share Posted October 3, 2012 (edited) Thank you Mr.Danyfirex It works great even if the list view is not a (GUICtrlCreateListView). Edited October 3, 2012 by EKY32 [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font] Link to comment Share on other sites More sharing options...
Danyfirex Posted October 3, 2012 Share Posted October 3, 2012 Only need put away part of code. I put some comments read it. expandcollapse popup; My example Gui #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListviewConstants.au3> #include <GuiListView.au3>Global Const $COLOR_GUI = 0x494E49 Global Const $COLOR_TEXT = 0xE6ECE0 $GUI = GUICreate('test', 300, 500, -1, -1) ;GUISetBkColor($COLOR_GUI) ; ======================= ListView 1 ; everything works, except: ; how can I remove the border (or change it's color) $listview = GUICtrlCreateListView("col1|col2|col3", 10, 10, 280, 200, $LVS_NOCOLUMNHEADER) GUICtrlSetBkColor(-1, $COLOR_GUI) GUICtrlSetColor(-1, $COLOR_TEXT) $item1 = GUICtrlCreateListViewItem("test|col22|col23", $listview) $item2 = GUICtrlCreateListViewItem("item1|col12|col13", $listview) $item3 = GUICtrlCreateListViewItem("item3|col32|col33", $listview) _GUICtrlListView_SetColumnWidth($listview, 0, 90) _GUICtrlListView_SetColumnWidth($listview, 1, 90) ; ======================= ListView 2 ; You needed to add a few styles <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $hListView = _GUICtrlListView_Create($GUI, "", 10, 220, 280, 200, BitOr($LVS_REPORT,$LVS_NOCOLUMNHEADER)) ; If you want to show the colunms header put away "$LVS_NOCOLUMNHEADER" _GUICtrlListView_SetExtendedListViewStyle($hListView, $LVS_EX_FULLROWSELECT) ;>>>>>>> Only put away this part. ;_GUICtrlListView_SetBkColor($hListView, $COLOR_GUI) ;_GUICtrlListView_SetTextBkColor($hListView, $COLOR_GUI) ;_GUICtrlListView_SetTextColor($hListView, $COLOR_TEXT) _GUICtrlListView_AddColumn($hListView, "Col 1", 90) _GUICtrlListView_AddColumn($hListView, "Col 2", 90) _GUICtrlListView_AddColumn($hListView, "Col 3", 90) _GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1, 1) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2, 2) _GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1, 2) _GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2) GUISetState(@SW_SHOW) While 1 $eMSG = GUIGetMsg() Switch $eMSG Case -3 Exit EndSwitch WEnd Regards Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
EKY32 Posted October 3, 2012 Author Share Posted October 3, 2012 Tank you so much [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font] Link to comment Share on other sites More sharing options...
Mat Posted October 3, 2012 Share Posted October 3, 2012 (edited) Actually all you need to do is take WS_EX_STATICEDGE out of the extended styles, so this works:GUICreate("Test", 400, 400) $listview = GUICtrlCreateListView("col1|col2|col3", 10, 10, 280, 200, -1, 0) GUICtrlCreateListViewItem("test|col22|col23", $listview) GUICtrlCreateListViewItem("item1|col12|col13", $listview) GUICtrlCreateListViewItem("item3|col32|col33", $listview) GUISetState() While GUIGetMsg() <> -3 Sleep(10) WEnd Edit: Can I also recommend you get hold of a program called ControlSpy made by microsoft. Incredibly useful for playing around with control styles and messages. Edited October 3, 2012 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
EKY32 Posted October 3, 2012 Author Share Posted October 3, 2012 Oh Mr.Mat !! thank you! this is really what I need, thank you both. [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font] 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