Jump to content

Recommended Posts

Posted

Hi all,
is there a way to disable a listview created with _GUICtrlListView_Create?

GUICtrlSetState($g_hListView,@SW_DISABLE) does not work, reading arround the form give me the idea that I need to use winapi but I have no clue how to disable it that way
thanks

#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>

$hGUI=GUICreate("ImageList Create", 400, 300)
$g_hListView = _GUICtrlListView_Create($hGUI, "", 2, 2, 394, 268)

GUISetState(@SW_SHOW)

_GUICtrlListView_AddColumn($g_hListView, "a", 120)
_GUICtrlListView_AddColumn($g_hListView, "b", 120)
_GUICtrlListView_AddItem($g_hListView, "1", 0)
_GUICtrlListView_AddItem($g_hListView, "2", 1)
_GUICtrlListView_AddSubItem($g_hListView, 0, "3", 1)
_GUICtrlListView_AddSubItem($g_hListView, 1, "4", 1)

;Not Working
GUICtrlSetState($g_hListView,@SW_DISABLE)

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()

 

  • Moderators
Posted (edited)

I would think it is apparent that if the OP is creating a listview and then disabling, he either wants it to be read only but scrollable - or would like to re-enable it at some point...

 

@OP, it is $GUI_DISABLE, not @SW_DISABLE, for controls.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

GUICtrlSetState($g_hListView, $GUI_DISABLE)

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

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
×
×
  • Create New...