Kiti Posted July 4, 2008 Share Posted July 4, 2008 Hello! I want to select something from the combo box, and when I click it it should write it (so many "it"!) down in the editbox. And do this over and over again, and form a list in the Editbox. But every second time the text in the editbox is replaced. muttley It would also be cool if I could put before each one "1.", "2.", "3." and so on. Here's my code:expandcollapse popup#include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $Form1_1 = GUICreate("Form1", 414, 222, 324, 184) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_1Close") $Cladiri = GUICtrlCreateCombo("", 72, 56, 145, 25) GUICtrlSetOnEvent($Cladiri, "CladiriChange") GuiCtrlSetdata($Cladiri,"Mina de Metal|Mina de Cristal|Sintetizator de Deuteriu|Uzina Solara|Uzina de Roboti|Santier Naval|Depozit de Metal|Depozit de Cristal|Bazin de Deuteriu|Laborator de Cercetari|Hangarul Aliantei|Siloz de Rachete") $Cercetari = GUICtrlCreateCombo("", 72, 88, 145, 25) GUICtrlSetOnEvent($Cercetari, "CercetariChange") $SantierNaval = GUICtrlCreateCombo("", 72, 120, 145, 25) GUICtrlSetOnEvent($SantierNaval, "SantierNavalChange") $Aparare = GUICtrlCreateCombo("", 72, 152, 145, 25) GUICtrlSetOnEvent($Aparare, "AparareChange") $Edit1 = GUICtrlCreateEdit("", 232, 8, 169, 209) GUICtrlSetData($Edit1, "Edit1") $Label1 = GUICtrlCreateLabel("Selectati constructiile in", 40, 16, 115, 17) $Label2 = GUICtrlCreateLabel("ordinea dorita :", 40, 32, 74, 17) $Button1 = GUICtrlCreateButton("OK", 104, 192, 75, 25) GUICtrlSetOnEvent($Button1, "Button1Click") $Label3 = GUICtrlCreateLabel("Cladiri:", 16, 60, 35, 17) $Label4 = GUICtrlCreateLabel("Cercetari:", 16, 92, 49, 17) $Label5 = GUICtrlCreateLabel("Nave:", 16, 123, 33, 17) $Label6 = GUICtrlCreateLabel("Aparare:", 16, 157, 44, 17) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Button1Click() EndFunc Func CladiriChange() $cladiridata = Guictrlread($Cladiri) GuictrlSetData($Edit1, $cladiridata & @CRlf) EndFunc Func CercetariChange() EndFunc Func SantierNavalChange() EndFunc Func AparareChange() EndFunc Func Form1_1Close() Exit 0 EndFunc Thank you! Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
goldenix Posted July 4, 2008 Share Posted July 4, 2008 (edited) I read it 3 times & i still dont understand what you are trying to do but this is how you can make the loop: Hire is an example from the help file: just search for a word Loop in the help file For $i = 5 to 1 Step -1 MsgBox(0, "Count down!", $i) Next MsgBox(0,"", "Blast Off!") For $i = 1 to 5 MsgBox(0, "Count up!", $i) Next MsgBox(0,"", "Blast Off!") Edited July 4, 2008 by goldenix My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list] Link to comment Share on other sites More sharing options...
Kiti Posted July 4, 2008 Author Share Posted July 4, 2008 (edited) I have a combo box, and an editbox. When I click something in the combo, what I click should be written in the editbox. Now, I click again an item in the combo box, and it should be added in the editbox, but without deleting the first added item. It should be after it. This way I'll create a list inside the editbox with the items in the combo box. How?Edit: I solved it with a ListVew. Thank you anyway! Edited July 4, 2008 by Kiti Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
goldenix Posted July 4, 2008 Share Posted July 4, 2008 ah well hire: _GUICtrlEdit_AppendText($hEdit, @CRLF & "Append to the end?") My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list] Link to comment Share on other sites More sharing options...
JustinMeyer Posted July 4, 2008 Share Posted July 4, 2008 I see you solved your problem with the list view but this is how you would do it with your original situation. ;GET THE DATA FROM BOTH CONTROLS $OLD_DATA = GUICtrlRead($YOUR_EDIT_BOX) $NEW_DATA = GUICtrlRead($YOUR_COMBO_BOX) ;COMBINE THE STRINGS / AND PUT THE OLD DATA ON THE NEXT LINE $UPDATE = $NEW_DATA & @CRLF & $OLD_DATA ;SET THE DATA TO THE COMBO BOX $UPDATE_COMBO = GUICtrlSetData($YOUR_COMBO_BOX,$UPDATE) 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