Jump to content

Recommended Posts

Posted

I have a single line showing from a Listview control. Does anyone have any tricks for hiding it?

I have tried all of the various border options but could not figure out any way to hide it. I am assuming that I need some other GUI element type of trick to go over top of it to hide it.

Thank you for your time.

Screenshot:

image.png.b9f6bb9e122fd8f6c2ac414346ed0142.png

Posted (edited)

I have to admit, I am not familiar with GDI+ yet.

The purpose of the empty label is simply to ensure that nobody can actually interact with the listviews. The ACLs are being polled and filled accordingly and at the moment it is just an ACL viewer and not editor. Here is the code:

GUICtrlCreateLabel(" ", 100 - 10, $cListViewPosV + 80 - 10, 1200, 800)
GUICtrlSetResizing(-1, $GUI_DOCKALL)

$idListview = GUICtrlCreateListView("col1", 100, $cListViewPosV + 80, 400, 300, $LVS_NOCOLUMNHEADER, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $LVS_EX_DOUBLEBUFFER))
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$sFILE_ALL_ACCESS = GUICtrlCreateListViewItem(" Full Control", $idListview)
$sFILE_EXECUTE = GUICtrlCreateListViewItem(" Traverse Folder / Execute File", $idListview)
$sFILE_READ_DATA = GUICtrlCreateListViewItem(" List Folder / Read Data", $idListview)
$sFILE_READ_ATTRIBUTES = GUICtrlCreateListViewItem(" Read Attributes", $idListview)
$sFILE_READ_EA = GUICtrlCreateListViewItem(" Read Extended Attributes", $idListview)
$sFILE_WRITE_DATA = GUICtrlCreateListViewItem(" Create Files / Write Data", $idListview)
$sFILE_APPEND_DATA = GUICtrlCreateListViewItem(" Create Folders / Append Data", $idListview)

_GUICtrlListView_SetColumnWidth($idListview, 0, $LVSCW_AUTOSIZE_USEHEADER)
GUICtrlSetState($idListview, $GUI_HIDE)


$idListview2 = GUICtrlCreateListView("col1", 480, $cListViewPosV + 80, 400, 300, $LVS_NOCOLUMNHEADER, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $LVS_EX_DOUBLEBUFFER))
GUICtrlSetResizing(-1, $GUI_DOCKALL)
$sFILE_WRITE_ATTRIBUTES = GUICtrlCreateListViewItem(" Write Attributes", $idListview2)
$sFILE_WRITE_EA = GUICtrlCreateListViewItem(" Write Extended Attributes", $idListview2)
$sFILE_DELETE_CHILD = GUICtrlCreateListViewItem(" Delete Subfolders and Files", $idListview2)
$sFILE_DELETE = GUICtrlCreateListViewItem(" Delete", $idListview2)
$sREAD_CONTROL = GUICtrlCreateListViewItem(" Read Permissions", $idListview2)
$sWRITE_DAC = GUICtrlCreateListViewItem(" Change Permissions", $idListview2)
$sWRITE_OWNER = GUICtrlCreateListViewItem(" Take Ownership", $idListview2)

EDIT: Also, the listview overlap slightly on purpose as a way of getting rid of the line from the first listview. Both listviews show a line on the right side.

Edited by WildByDesign
  • Solution
Posted

I see.   You could use something like this instead of creating 2 listviews :

#include <WindowsConstants.au3>
#include <GUIListView.au3>
#include <GUIConstants.au3>

GUICreate("Example", 300, 300)
Local $idListView = GUICtrlCreateListView("Test", 10, 10, 280, 280, $LVS_NOCOLUMNHEADER + $LVS_SINGLESEL, $LVS_EX_CHECKBOXES)
_GUICtrlListView_SetView($idListView, 3)

Local $aTest[5] = ["test1", "test2", "test3", "test4", "test5"]
For $i = 0 To UBound($aTest) - 1
  GUICtrlCreateListViewItem($aTest[$i], $idListView)
Next

GUISetState()

While True
  Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
      Exit
  EndSwitch
WEnd

ps. Next time, please provide runable code, not just a part of a script.  You need to help us to help you...

Posted

That’s my mistake, I apologize. Every single snippet of code examples on the forum that have helped me were runnable code in nice, small examples. So I understand. It wastes more time if it’s not readily runnable.

I will try your example after dinner and also post a small, runnable example of the issue.

Posted

I got a chance to try it out right now. Following your suggestion, I added the line:

_GUICtrlListView_SetView($idListView, 3)

That worked like absolute magic. Thank you. That was a good, proper fix.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...