abiteric Posted June 18, 2009 Share Posted June 18, 2009 1 GUICtrlCreateList , 5 item like : this line A this line B this line B this line A this line C if user select the 3rd line ( the 2nd " this line B " ) and press buton to delete, how it works ? case $button_delete _function() Func _function() $x = GUICtrlRead($List1) ; and..... do what @@? Return msgbox(0,"OK!", "The line u delete") endFunc My website about Y-mate 網拍輔助程式 : http://www.L2play.comMy Blog ( Tranditional Chinese ) 開發小組的部落格 : http://tw.myblog.yahoo.com/play19990909 Link to comment Share on other sites More sharing options...
billthecreator Posted June 18, 2009 Share Posted June 18, 2009 take a look at the help file... #Include <GuiListBox.au3> _GUICtrlListBox_DeleteString($hWnd, _GUICtrlListBox_GetCurSel($hWnd)) i found this under 5 seconds [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
Zedna Posted June 18, 2009 Share Posted June 18, 2009 (edited) 1) - Remember index of selected item - Read all lines from your ListBox into array variable - erase content of whole ListBox - add all lines from array except of selected one Use_GUICtrlListBox_GetCount(), _GUICtrlListBox_GetText(), _GUICtrlListBox_AddString from #Include <GuiListBox.au3> 2) or use _GUICtrlListBox_GetCurSel () and _GUICtrlListBox_DeleteString($hWnd, $iIndex) --> this is much simpler EDIT: I'm too late here :-) Edited June 18, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
billthecreator Posted June 18, 2009 Share Posted June 18, 2009 EDIT: I'm too late here :-) haha, sorry [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
abiteric Posted June 18, 2009 Author Share Posted June 18, 2009 take a look at the help file... #Include <GuiListBox.au3> _GUICtrlListBox_DeleteString($hWnd, _GUICtrlListBox_GetCurSel($hWnd)) i found this under 5 seconds i just want to say..... my eyes got popo.... use AUTOIT almost 1.5 years never found #Include <GuiListBox.au3> before... anyway thanks a lot ^^"! Func delselec() $x = _GUICtrlListBox_GetCurSel($List1) if $x <> -1 Then _GUICtrlListBox_DeleteString($List1,$x) EndFunc My website about Y-mate 網拍輔助程式 : http://www.L2play.comMy Blog ( Tranditional Chinese ) 開發小組的部落格 : http://tw.myblog.yahoo.com/play19990909 Link to comment Share on other sites More sharing options...
billthecreator Posted June 18, 2009 Share Posted June 18, 2009 i just want to say..... my eyes got popo....use AUTOIT almost 1.5 years never found #Include <GuiListBox.au3> before...anyway thanks a lot ^^"!Func delselec() $x = _GUICtrlListBox_GetCurSel($List1) if $x <> -1 Then _GUICtrlListBox_DeleteString($List1,$x)EndFunc you're welcome... its under the UDF part of the help file. close to the bottom of the treeview [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap 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