Jump to content

Making a Listview not clickable?


Go to solution Solved by johnmcloud,

Recommended Posts

  • Moderators
Posted

What do you mean "I can't scroll"? What kind of control are you setting to disabled? It will really help us help you if you post your code so we can see what you're trying to do

"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

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
Posted (edited)

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
  • Solution
Posted

;~ 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

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...