YunusEmre Posted August 19, 2014 Share Posted August 19, 2014 Hi all How I want the enter key to activate thanks expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> Global $IniDir = @ScriptDir & "\Trial.ini" If Not FileExists($IniDir) Then FileOpen($IniDir, 1) $Form1_1 = GUICreate("Notes record", 491, 224) $Input1x = GUICtrlCreateInput("", 8, 8, 369, 21) $addbutton = GUICtrlCreateButton("Add", 391, 6, 91, 29) $List1 = GUICtrlCreateList("", 8, 40, 473, 175) GUISetState(@SW_SHOW) _IniRead_ListAdd() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $addbutton $Input_Read = GUICtrlRead($Input1x) If Not StringInStr($Input_Read, "|") And $Input_Read <> "" Then GUICtrlSetData($Input1x, "") IniWrite($IniDir, "Notes", "1", IniRead($IniDir, "Notes", "1", "") & $Input_Read & "|") _IniRead_ListAdd() Else MsgBox(0, "", "Please '|' Do not use karakrer." & @CRLF & "Input to write something!") EndIf EndSwitch WEnd Func _IniRead_ListAdd() Local $Ini_Read = IniRead($IniDir, "Notes", "1", "") ConsoleWrite($Ini_Read & @CRLF) Local $IniRead_Split = StringSplit($Ini_Read, "| & @CRLF") GUICtrlSetData($List1, "") For $i = 1 To $IniRead_Split[0] If $IniRead_Split[$i] <> "" Then GUICtrlSetData($List1, $IniRead_Split[$i]) Next EndFunc Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 19, 2014 Moderators Share Posted August 19, 2014 YunusEmre,Welcome to the AutoIt forums. I would add an Accelerator key to do this. Look for the <<<<<<<<<<<<< lines: expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> Global $IniDir = @ScriptDir & "\Trial.ini" $Form1_1 = GUICreate("Notes record", 491, 224) $Input1x = GUICtrlCreateInput("", 8, 8, 369, 21) $addbutton = GUICtrlCreateButton("Add", 391, 6, 91, 29) $List1 = GUICtrlCreateList("", 8, 40, 473, 175) ; Create a dummy control <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $idDummy = GUICtrlCreateDummy() GUISetState(@SW_SHOW) ; Set ENTER to fire the dummy control <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Local $aAccelKeys[1][2] = [["{ENTER}", $idDummy]] GUISetAccelerators($aAccelKeys) _IniRead_ListAdd() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idDummy ; If the dummy was fired, check if the input has focus <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< If _WinAPI_GetFocus() = GUICtrlGetHandle($Input1x) Then ; If it does, then continue with the code for $addbutton <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ContinueCase EndIf Case $addbutton $Input_Read = GUICtrlRead($Input1x) If Not StringInStr($Input_Read, "|") And $Input_Read <> "" Then GUICtrlSetData($Input1x, "") IniWrite($IniDir, "Notes", "1", IniRead($IniDir, "Notes", "1", "") & $Input_Read & "|") _IniRead_ListAdd() Else MsgBox(0, "", "Please '|' Do not use karakrer." & @CRLF & "Input to write something!") EndIf EndSwitch WEnd Func _IniRead_ListAdd() Local $Ini_Read = IniRead($IniDir, "Notes", "1", "") ConsoleWrite($Ini_Read & @CRLF) Local $IniRead_Split = StringSplit($Ini_Read, "| & @CRLF") GUICtrlSetData($List1, "") For $i = 1 To $IniRead_Split[0] If $IniRead_Split[$i] <> "" Then GUICtrlSetData($List1, $IniRead_Split[$i]) Next EndFunc ;==>_IniRead_ListAddPlease ask if you have any questions. M23 YunusEmre 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...
YunusEmre Posted August 19, 2014 Author Share Posted August 19, 2014 Thank you @Melba23 How to .ini A hundred get to the bottom line after the character sample [Notes] 1=123|456789|...100 2=123|456789|...100 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 20, 2014 Moderators Share Posted August 20, 2014 YunusEmre,Sorry, I do not understand the question. 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...
YunusEmre Posted August 20, 2014 Author Share Posted August 20, 2014 ini file in the next post to go to the bottom line? 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