leegold Posted July 7, 2013 Posted July 7, 2013 Hi, Googled and searched - apologize if this had been asked before. Say we create a list box: $mylist = GUICtrlCreateList(....), we then populate the list box with a few rows. It's well documented and easy to clear the entire list. But the action I'm looking for is: the user selects a row(s) ...ie a row gets highlighted (a mouse click eg. does that right now). Is there a way to delete just that row? Either a button or a mouse right click-> delete? Is is possible to select multiple rows and do the same? I don't want to allow edits a row's text (that's why I thought to use a List Box), but I need added rows to be deletable and of course I assume the List Box's "internal array" would be updated/refreshed to reflect adds and deletes... Thanks
Andreu Posted July 7, 2013 Posted July 7, 2013 (edited) $mylist = your GUICtrlCreateList here's a working example: _GUICtrlListBox_DeleteString($mylist, _GUICtrlListBox_GetCurSel($mylist)) Note the two functions used. _GUICtrlListBox_GetCurSel = http://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlListBox_GetCurSel.htm _GUICtrlListBox_DeleteString = http://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlListBox_DeleteString.htm Note: You should already have #include <GUIConstantsEx.au3> , but you will also need #include <GuiListBox.au3> Have a good day Edit: Just noticed you stated you also wanted to be able to edit the text. _GUICtrlListBox_ReplaceString = http://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlListBox_ReplaceString.htm Should do the trick. Edited July 7, 2013 by Andreu
bleh Posted July 7, 2013 Posted July 7, 2013 $List1 = GUICtrlCreateList("", 168, 64, 121, 97, $LBS_EXTENDEDSEL) If you want to select multiple entries.
leegold Posted July 9, 2013 Author Posted July 9, 2013 Thank you. I will give it a try. Thanks again!
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