Jump to content
Sign in to follow this  
nyke0

Making a Listview not clickable?

Recommended Posts

nyke0

Is that possible? 

GUICtrlSetState(-1, $GUI_DISABLE)

Is a little too much, I can't scroll then.

Share this post


Link to post
Share on other sites
JLogan3o13

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


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
nyke0

I meant the GUICtrlSetState(-1, $GUI_DISABLE) Function, if I use it, I can't scroll. 

Share this post


Link to post
Share on other sites
JLogan3o13

Again, you need to post your entire code so we can see what you're doing, rather than having us guess from 1 line.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
nyke0

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
Wruck

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
nyke0

No, I need a Listview, and disable to click items.

Share this post


Link to post
Share on other sites
johnmcloud

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

×