jonny1234 Posted November 20, 2006 Share Posted November 20, 2006 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 Link to comment Share on other sites More sharing options...
GaryFrost Posted November 20, 2006 Share Posted November 20, 2006 Works for me, in classic mode and themed mode on WinXP Pro SP2 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
jonny1234 Posted November 20, 2006 Author Share Posted November 20, 2006 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? Regards, Jonny Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now