Jump to content
Sign in to follow this  
nyke0

Making a Listview not clickable?

Recommended Posts

ok ...

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 400, 220, -1, -1)
$ListView1 = GUICtrlCreateListView("Col 1|Col 2|Col 3", 0, 0, 400, 220)

For $i = 0 to 20
    GUICtrlCreateListViewItem('Text|Text|Text', $ListView1)
Next

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

Try using GUICtrlCreateList instead of GUICtrlCreateListView? There is a style in just the List called, $LBS_NOSEL, that might be what you are looking for?

#include <GUIConstantsEx.au3>
#include <ListboxConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 400, 220, -1, -1)
$ListView1 = GUICtrlCreateList("", 0, 0, 400, 220, $LBS_NOSEL)

For $i = 0 to 20
    GUICtrlSetData($ListView1, 'Text|Text|Text')
Next

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
Edited by Wruck

Share this post


Link to post
Share on other sites

;~ Johnmcloud  2014
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <StructureConstants.au3>

$Form = GUICreate("Johnmcloud Test Code", 400, 220, -1, -1)
$hListView = GUICtrlCreateListView("Col 1|Col 2|Col 3", 0, 0, 400, 220)

For $i = 0 To 100
    GUICtrlCreateListViewItem('Text|Text|Text', $hListView)
Next

GUISetState(@SW_SHOW)

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam)
    Local $tNMHDR, $IdFrom, $iCode
    $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
    $IdFrom = DllStructGetData($tNMHDR, "IdFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $IdFrom
        Case $hListView
            Switch $iCode
                Case $LVN_ITEMACTIVATE
                    Return 1
                Case $LVN_ITEMCHANGING
                    Return 1
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×
×
  • Create New...