Sign in to follow this  
Followers 0
jonny1234

LVS_SHOWSELALWAYS works in 2000 but not in XP

3 posts in this topic

Hi,

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)
$item1=GUICtrlCreateListViewItem("item2|col22|col23",$listview)
$item2=GUICtrlCreateListViewItem("item1|col12|col13",$listview)
$item3=GUICtrlCreateListViewItem("item3|col32|col33",$listview)
$input1=GUICtrlCreateInput("",20,200, 150)
GUICtrlSetState(-1,$GUI_DROPACCEPTED)  ; to allow drag and dropping
GUISetState()
GUICtrlSetData($item2,"ITEM1")
GUICtrlSetData($item3,"||COL33")
GUICtrlDelete($item1)

Do
  $msg = GUIGetMsg ()
     
   Select
      Case $msg = $button
         MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2)
      Case $msg = $listview
         MsgBox(0,"listview", "clicked="& GUICtrlGetState($listview),2)
   EndSelect
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 3.2.0.1 and 3.2.1.13.

Regards,

Jonny

Share this post


Link to post
Share on other sites



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

post-8828-1164045985_thumb.jpg

and when the ListView loses the focus, I get:

post-8828-1164046041_thumb.jpg

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?

Regards,

Jonny

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  
Followers 0