lrstndm Posted October 13, 2010 Share Posted October 13, 2010 Hello, i have a problem with a tool of mine can someone help me please?? if i choose a profile and click load the information should enter in the inputbox, but i don't know how to do it. i want that i can enter something in the inputbox with a click on the button The text to put in the inputbox need to come from a .ini file The inifile i used for this tool is in the attachments. Thanks This is the config.ini file: [settings] profile1=profilename1 profile2=profilename2 This is the autoit code: #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("test", 286, 138, 192, 124) $Combo1 = GUICtrlCreateCombo("", 16, 16, 153, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData( $Combo1, "profile1|profile2") $Button1 = GUICtrlCreateButton("Load", 16, 40, 81, 25) $Input1 = GUICtrlCreateInput("", 16, 72, 121, 21) GUISetState(@SW_SHOW) $profile1 = IniRead( "config.ini", "settings", "profile1", "") $profile2 = IniRead( "config.ini", "settings", "profile2", "") While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button1 If GUICtrlRead($Combo1) = $profile1 Then ;write the name of profile1 into $input1 (the name is the text who is in the config.ini file) (that is: profilename1) ElseIf GUICtrlread($Combo1) = $profile2 Then ;write the name of profile2 into $input1 (the name is the text who is in the config.ini file) (that is: profilename2) EndIf EndSelect WEnd Regards, Lars Link to comment Share on other sites More sharing options...
UEZ Posted October 13, 2010 Share Posted October 13, 2010 (edited) Try this:#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("test", 286, 138, 192, 124) $Combo1 = GUICtrlCreateCombo("", 16, 16, 153, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $keys = IniReadSection( "config.ini", "Settings" ) $profiles = "" For $i = 1 To UBound($keys) - 1 $profiles &= $keys[$i][1] & "|" Next GUICtrlSetData( $Combo1, $profiles, $keys[1][1]) $Button1 = GUICtrlCreateButton("Load", 16, 40, 81, 25) $Input1 = GUICtrlCreateInput("", 16, 72, 121, 21) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button1 GUICtrlSetData($Input1, GUICtrlRead($Combo1)) EndSelect WEndBr,UEZPS: I was faster than Melba23 Edited October 13, 2010 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
lrstndm Posted October 13, 2010 Author Share Posted October 13, 2010 Thank you so much. Link to comment Share on other sites More sharing options...
GEOSoft Posted October 13, 2010 Share Posted October 13, 2010 (edited) Try this:<snip>Br,UEZPS: I was faster than Melba23 I was going to comment on this but I made a promise to the big M and I don't remember if yesterday was the last day or if it's today. Edited October 13, 2010 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 13, 2010 Moderators Share Posted October 13, 2010 George,You have to wait until tomorrow - sorry! UEZ,The mine rescue in Chile is taking too much of my attention today - but as Schwarzenegger says: "I'll be back!" 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...
GEOSoft Posted October 13, 2010 Share Posted October 13, 2010 I had that hunch but then again you might be sucking me into an extra day with time zones. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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