Jump to content

disable listview select


Recommended Posts

hi,

can i disable the select highlighted ($LVS_EX_FULLROWSELECT) in the listview control?

tks

If you mean how can you change the style of a listview which is in your script, then GuiCtrlSetStyle.

If you mean how can you deselect the highlighted line in a listview in your script then see _GUICtrlListViewSetItemSelState in GuiListView in the Include folder.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

If you mean how can you change the style of a listview which is in your script, then GuiCtrlSetStyle.

If you mean how can you deselect the highlighted line in a listview in your script then see _GUICtrlListViewSetItemSelState in GuiListView in the Include folder.

sorry,

i would no compare the highlighted in case of mouse down il listview item/subitem...

Link to comment
Share on other sites

sorry,

i would no compare the highlighted in case of mouse down il listview item/subitem...

I'm afraid I don't understand that silvano. ¿Can you try explaining that in another way?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I'm afraid I don't understand that silvano. ¿Can you try explaining that in another way?

sorry, i don't speak very good english.

but i have a listview control and i not like when i press the mouse left button to highlighted the line...

please watch the image attached

tks for patient...

post-18288-1188217573_thumb.jpg

Link to comment
Share on other sites

sorry, i don't speak very good english.

but i have a listview control and i not like when i press the mouse left button to highlighted the line...

please watch the image attached

tks for patient...

OK I understand. Here is one way to do it. It doesn't stop the item being hilighted it just removes the highlight so there is a flicker. I think there should be a better way than this but I don't know it.

#include <GUIConstants.au3>
#include <guilistview.au3>


Global Const $WM_NOTIFY = 0x004E
Global Const $NM_FIRST = 0
Global Const $NM_CLICK = ($NM_FIRST - 2)

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form1", 413, 298, 303, 219)
$ListView1 = GUICtrlCreateListView("col1|col2", 104, 64, 250, 150, BitOR($LVS_REPORT,$LVS_SHOWSELALWAYS))
GUICtrlSendMsg(-1, 0x101E, 0, 50)
GUICtrlSendMsg(-1, 0x101E, 1, 50)
$ListView1_0 = GUICtrlCreateListViewItem("item1|sub1", $ListView1)
$ListView1_2 = GUICtrlCreateListViewItem("item2|sub2", $ListView1)
$ListView1_3 = GUICtrlCreateListViewItem("", $ListView1)
$l = GUICtrlCreateLabel("",1,1,1,1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events")

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

    EndSwitch
WEnd




Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam)
    If ControlGetFocus('Testing') <> 'Form1' Then
        #forceref $hWndGUI, $MsgID, $wParam
        Local $tagNMHDR, $event
        $tagNMHDR = DllStructCreate("int;int;int", $lParam);NMHDR (hwndFrom, idFrom, code)
        If @error Then Return
        $event = DllStructGetData($tagNMHDR, 3)
        Select
            Case $wParam = $ListView1

                 Select
                Case $event = $NM_CLICK
                   _GUICtrlListViewSetItemSelState($ListView1, _GUICtrlListViewGetCurSel($ListView1),0,0)
                   GUICtrlSetState($l,$GUI_FOCUS);shifts focus to invisible label and removes the dotted line around the item

                EndSelect
        EndSelect
        $tagNMHDR = 0
        $event = 0
        $lParam = 0
        Return $GUI_RUNDEFMSG
    EndIF
EndFunc
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...