Jump to content

Recommended Posts

Posted

Is it possible that no row will be selected in a listview when clicking on it.

I dont want the blue background color to show up.

I know that it can be done by this code

GUICtrlSetState($listview, $GUI_DISABLE)

But this is not what i wnat.

Hope someone can help me:)

regards,

lrstndm

Posted

Hi,

Try this :

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListViewConstants.au3>
#include <StructureConstants.au3>
 
#region GUI
Local $hGUI = GUICreate("MyGUI")
 
Global $iLw1 = GUICtrlCreateListView("Col1", 10, 10)
 
For $i = 1 To 10
    GUICtrlCreateListViewItem($i, $iLw1)
Next
 
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
GUISetState(@SW_SHOW, $hGUI)
#endregion
 
While GUIGetMsg() <> $GUI_EVENT_CLOSE
    Sleep(10)
WEnd
 
GUIDelete($hGUI)
 
Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
    Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
 
    Local $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    Local $iCode = DllStructGetData($tNMHDR, "Code")
 
    Switch $iIDFrom
        Case $iLw1
            Switch $iCode
                Case $LVN_ITEMCHANGING
                    Return -1
            EndSwitch
    EndSwitch
 
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Br, FireFox.

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