retaly Posted September 1, 2012 Share Posted September 1, 2012 Hy dear autoit users, i've got one small problem what i cant fixing. i've made one gui, with one edit, and one list box, how does it work? -when i click 1x to one text in listbox, its appear in edit, but if i click to one more text in list, its remove the first text in edit. and i'd like to do the next: -its appear in edit when i click 2x, and dont rewrite each other,i want under each other. sorry for my bad english, i guess some1 can help me. regards. expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <file.au3> #include <GuiEdit.au3> #include <Constants.au3> #include <GUIListBox.au3> ;local $msg Local $msg, $mylist, $Edit1 #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 438, 192, 124) ;GUISetState(@SW_SHOW) $Edit1 = GUICtrlCreateEdit("", 30, 72, 445, 265) GUISetState() GUICtrlSetColor(-1, 0x00C2FF) ;GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetData(-1, "") GUICtrlSetState(-1, $GUI_DISABLE) $mylist = GUICtrlCreateList("", 480, 72, 121, 265) GUICtrlSetLimit(-1, 200) GUICtrlSetData(-1, "Test1|Test2|Test3") $button = GUICtrlCreateButton("Exit", 280, 368, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $msg = GUIGetMsg() If $msg = $mylist Then GUICtrlSetData($Edit1, GUICtrlRead($mylist)) EndIf If $msg = $GUI_EVENT_CLOSE Then ExitLoop Endif If $msg = $button Then ; If button is pushed, exit without saving to text file ExitLoop EndIf WEnd GUIDelete() Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 1, 2012 Moderators Share Posted September 1, 2012 retaly, Does this do what you want: #include <GUIConstantsEx.au3> $sData = "" $Form1 = GUICreate("Form1", 615, 438, 192, 124) $Edit1 = GUICtrlCreateEdit("", 30, 72, 445, 265, $ES_READONLY) $mylist = GUICtrlCreateList("", 480, 72, 121, 265) GUICtrlSetData(-1, "Test1|Test2|Test3") $button = GUICtrlCreateButton("Exit", 280, 368, 75, 25) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $mylist $sData &= GUICtrlRead($mylist) & @CRLF GUICtrlSetData($Edit1, $sData) Case $GUI_EVENT_CLOSE, $button Exit EndSwitch WEnd All clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
retaly Posted September 1, 2012 Author Share Posted September 1, 2012 oh, its working well, thank you very much!!! one bit question, i'd like to do with double click, i mean it paste texts in edit when i clicked double to text, and do nothing for one click Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 1, 2012 Moderators Share Posted September 1, 2012 retaly, paste texts in edit when i clicked double to text, and do nothing for one clickSome people are really picky! This should do it: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $sData = "" $Form1 = GUICreate("Form1", 615, 438, 192, 124) $Edit1 = GUICtrlCreateEdit("", 30, 72, 445, 265, $ES_READONLY) $mylist = GUICtrlCreateList("", 480, 72, 121, 265) GUICtrlSetData(-1, "Test1|Test2|Test3") $button = GUICtrlCreateButton("Exit", 280, 368, 75, 25) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $button Exit EndSwitch WEnd Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word $iCode = BitShift($wParam, 16) ; Hi Word Switch $iCode Case $LBN_DBLCLK ; Sent when the user double-clicks a string in a list box Switch $iIDFrom Case $mylist $sData &= GUICtrlRead($mylist) & @CRLF GUICtrlSetData($Edit1, $sData) EndSwitch EndSwitch EndFunc And does it? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
retaly Posted September 1, 2012 Author Share Posted September 1, 2012 fuu, it seems n1 but got this problem: Case $LBN_DBLCLK Case ^ ERROR thank you for your hep, u are rly helpfull man. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 1, 2012 Moderators Share Posted September 1, 2012 retaly, My apologies, I deleted too many unnecessary includes. You need these ones: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ListBoxConstants.au3> Sorry about that. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
retaly Posted September 1, 2012 Author Share Posted September 1, 2012 nothing, working well thank you very much again, u helped me a lot now!! Link to comment Share on other sites More sharing options...
retaly Posted September 2, 2012 Author Share Posted September 2, 2012 hy again,i'd like to ask about one more thing,if u click 2x to Test 1,send in edit box as: Test1 ""because it doesnt work in this form:GUICtrlSetData(-1, "Test1 ""|Test2|Test3")and i dont have idea for it :// Link to comment Share on other sites More sharing options...
retaly Posted September 3, 2012 Author Share Posted September 3, 2012 got one problem too, if i write in edit box then click to some text it delet what i wrote in edit. :/ help me in that 2 thing if its possible, then im rdy Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 20, 2012 Moderators Share Posted September 20, 2012 retaly, I think this should solve those 2 problems - look for the <<<<<<<< lines as usual. expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ListBoxConstants.au3> $Form1 = GUICreate("Form1", 615, 438, 192, 124) $Edit1 = GUICtrlCreateEdit("", 30, 72, 445, 265) $mylist = GUICtrlCreateList("", 480, 72, 121, 265) GUICtrlSetData(-1, 'Test1 ""|Test2|Test3') ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $button = GUICtrlCreateButton("Exit", 280, 368, 75, 25) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $button Exit EndSwitch WEnd Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word $iCode = BitShift($wParam, 16) ; Hi Word Switch $iCode Case $LBN_DBLCLK Switch $iIDFrom Case $mylist ; Read current content $sData = GUICtrlRead($Edit1) ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; What are we adding $sAdd = GUICtrlRead($mylist) ; As long as we clicked on a list item If $sAdd Then ; Add the clicke4ed item $sData &= GUICtrlRead($mylist) & @CRLF ; Reset the edit content GUICtrlSetData($Edit1, $sData) EndIf EndSwitch EndSwitch EndFunc Is that how you want it? M23 iahngy 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
retaly Posted September 22, 2012 Author Share Posted September 22, 2012 i wanted that!! ooh, thank you very much, fuuu, u are a god :DDD <3 tyty Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 22, 2012 Moderators Share Posted September 22, 2012 retaly, Glad I could help. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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