blink314 Posted September 6, 2005 Share Posted September 6, 2005 Is there any way to determine what column a user has clicked on for a listview control? I can determine the row and I know GUICtrlSetState claims you can find what column was clicked, but it doesnt work when a ListViewItem event triggers it. Any ideas? I would like to make some "cell" manipulation routines but they will be much harder if I cannot determine which cell the user clicks on! Kevin Link to comment Share on other sites More sharing options...
GaryFrost Posted September 6, 2005 Share Posted September 6, 2005 from the help example: not the Case $msg = $listview section #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_SORTDESCENDING) $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_ACCEPTFILES) ; 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 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...
blink314 Posted September 6, 2005 Author Share Posted September 6, 2005 But this doesnt work for clicking on a ListViewItem does it? It only works if you click on the column heading, right? I'm trying to get it so I can click on a ListViewItem and get the "coordinates" of the control I clicked on (ie, row 4, column 2). Kevin Link to comment Share on other sites More sharing options...
GaryFrost Posted September 6, 2005 Share Posted September 6, 2005 ok, understand what your looking for. Don't know of a way to get row and column selected Can get either row or column. 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...
blink314 Posted September 6, 2005 Author Share Posted September 6, 2005 Ahhh, ok, thanks for looking. I'll try and work around it somehow. Maybe have the user select a row then select column... I'll see. Thanks again, Kevin Link to comment Share on other sites More sharing options...
Krass Posted May 12, 2006 Share Posted May 12, 2006 I have the same problem now, I need the row and column. since this topic is from the Sep 6 2005, I just ask again: is there a possible solution to get both information which item in which row/column was clicked ? if not, any plans to do it into the near future ? Link to comment Share on other sites More sharing options...
FuryCell Posted August 18, 2009 Share Posted August 18, 2009 I'm also attempting to do the same thing. Anyone have any ideas? HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. 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