htclub Posted November 21, 2008 Share Posted November 21, 2008 note: sorry , If I type English wrong because my English is poor Help me I want to creat list view and 4 button (add,remove,up,down) click add: add item to listview click remove: remove selected item from listview click up: move item from listview up click down: move item from listview down Link to comment Share on other sites More sharing options...
toonboon Posted November 21, 2008 Share Posted November 21, 2008 Firs, you can use Koda Formdesigner to design the requested form. Do that first, and then select generate code with options. Select use variables where possible and something like create functions (not sure about last one) post that code here and we'll help you with what autoit functions are best to use for you. Remember, we are NOT going to write the exact code for you. [right]~What can I say, I'm a Simplistic person[/right] Link to comment Share on other sites More sharing options...
htclub Posted November 21, 2008 Author Share Posted November 21, 2008 Koda Formdesigner can creat gui (code can make gui)but i need code to if i click:click add: add item to listviewclick remove: remove selected item from listviewclick up: move item from listview upclick down: move item from listview down Link to comment Share on other sites More sharing options...
Aceguy Posted November 21, 2008 Share Posted November 21, 2008 Try the HelpFile, its ermm, helpfull. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Andreik Posted November 21, 2008 Share Posted November 21, 2008 I wrote this example with add and del functions to show you how can you do what you want: expandcollapse popupGlobal $ITEM[1] $ITEM[0] = 0 Global $LISTVIEW $GUI = GUICreate("EXAMPLE",400,200) $LISTVIEW = GUICtrlCreateListView("COL1|COL2|COL3|COL4",5,5,200,190,BitOR(0x00100000,0x00200000)) $ADD = GUICtrlCreateButton("Add",250,5,100,20) $DEL = GUICtrlCreateButton("Delete",250,30,100,20) GUISetState(@SW_SHOW,$GUI) While 1 $MSG = GUIGetMsg() Select Case $MSG = $ADD Call("Add") Case $MSG = $DEL Call("Del") Case $MSG = -3 Exit EndSelect Sleep(15) WEnd Func Add() $ADD_GUI = GUICreate("ADD",150,130,-1,-1,0x16C80000,0x00000189) $ITEM1 = GUICtrlCreateInput("TEXT1",5,5,140,20,0x01) $ITEM2 = GUICtrlCreateInput("TEXT2",5,30,140,20,0x01) $ITEM3 = GUICtrlCreateInput("TEXT3",5,55,140,20,0x01) $ITEM4 = GUICtrlCreateInput("TEXT4",5,80,140,20,0x01) $ADD_BUTTON = GUICtrlCreateButton("ADD",50,105,50,20) GUISetState(@SW_SHOW,$ADD_GUI) While 1 $ADD_MSG = GUIGetMsg() If $ADD_MSG = $ADD_BUTTON Then $TEXT = GUICtrlRead($ITEM1) & "|" & GUICtrlRead($ITEM2) & "|" & GUICtrlRead($ITEM3) & "|" & GUICtrlRead($ITEM4) GUIDelete($ADD_GUI) ReDim $ITEM[UBound($ITEM)+1] $ITEM[UBound($ITEM)-1] = GUICtrlCreateListViewItem($TEXT,$LISTVIEW) ExitLoop EndIf Sleep(20) WEnd EndFunc Func Del() If GUICtrlRead($LISTVIEW)-5 > 0 Then GUICtrlDelete($ITEM[GUICtrlRead($LISTVIEW)-5]) EndIf EndFunc Hope that helps. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
htclub Posted November 22, 2008 Author Share Posted November 22, 2008 (edited) how can move item up or down Edited November 22, 2008 by htclub Link to comment Share on other sites More sharing options...
rasim Posted November 22, 2008 Share Posted November 22, 2008 how can move item up or down_GUICtrlListView_DeleteItem() _GUICtrlListView_InsertItem() 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