Jump to content
Sign in to follow this  

LVS_SHOWSELALWAYS works in 2000 but not in XP

Recommended Posts


I can get a ListView to keep its selection highlighted when it loses the focus in Windows 2000 but not in XP, using the code below taken from the AutoIt help file. I just added the $LVS_SHOWSELALWAYS style.

#include <GUIConstants.au3>

GUICreate("listview items",220,250, 100,200,-1,$WS_EX_ACCEPTFILES)
GUISetBkColor (0x00E0FFFF) ; will change background color

$listview = GUICtrlCreateListView ("col1  |col2|col3  ",10,10,200,150,$LVS_SHOWSELALWAYS)
$button = GUICtrlCreateButton ("Value?",75,170,70,20)
$input1=GUICtrlCreateInput("",20,200, 150)
GUICtrlSetState(-1,$GUI_DROPACCEPTED)  ; to allow drag and dropping

  $msg = GUIGetMsg ()
      Case $msg = $button
         MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2)
      Case $msg = $listview
         MsgBox(0,"listview", "clicked="& GUICtrlGetState($listview),2)
Until $msg = $GUI_EVENT_CLOSE

Please can you tell me why it may not be working for me in XP. I'm using Windows XP SP2 and I have tried AutoIt versions and



Share this post

Link to post
Share on other sites

For me, when the ListView has the focus on Windows XP, I get:


and when the ListView loses the focus, I get:


but in Windows 2000, the selected item stays the same colour (i.e. blue background) whether the ListView has the focus or not.

Are the above images the way it is supposed to be in Windows XP?



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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...