DickG Posted January 1, 2016 Share Posted January 1, 2016 When I open a GUI that has an Input box, and the text for that box is long, the text has scrolled all the way to the right. I would like it to show the beginning of the text rather than the end. So I have to click inside the box and press Home to read the beginning.Is there a way to do make it scroll left in the Input box? Link to comment Share on other sites More sharing options...
water Posted January 1, 2016 Share Posted January 1, 2016 Maybe this thread helps My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 1, 2016 Moderators Share Posted January 1, 2016 DickG,Or perhaps like this:#include <GUIConstantsEx.au3> $sText = "A nice long string to get the input scrolled to the right" $hGUI = GUICreate("Test", 500, 500) $cInput = GUICtrlCreateInput($sText, 10, 10, 200, 20) GUISetState() ControlSend($hGUI, "", $cInput, "{HOME}") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndM23 Skysnake and Xandy 2 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...
water Posted January 1, 2016 Share Posted January 1, 2016 This Google search will return similar results. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
DickG Posted January 1, 2016 Author Share Posted January 1, 2016 Maybe this thread helpsAwesome! That works great! I could not find anything on this forum when I typed "cursor position input box". I was not aware of the _GUICtrlEdit_SetSel() command. I guess searching the AutoIt forums gives me better results from Google! :-)Thanks much, water. Link to comment Share on other sites More sharing options...
water Posted January 1, 2016 Share Posted January 1, 2016 Correct. At the moment Google gives the best search results as the forums search feature is awful since the last upgrade Did you try the solution Melba provided? I think this is even more elegnat as it doesn't need to include a whole UDF. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
UEZ Posted January 1, 2016 Share Posted January 1, 2016 (edited) My idea:expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> AutoItSetOption("GUIOnEventMode", 1) Global Const $hGUI = GUICreate("Test", 232, 90) Global Const $iInput = GUICtrlCreateInput("", 42, 30, 140), $hInput = GUICtrlGetHandle($iInput) Global Const $iButton = GUICtrlCreateButton("OK", 190, 50, 32, 32) GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") While Sleep(100) WEnd Func _Exit() GUIDelete() Exit EndFunc Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Local $iIDFrom = _WinAPI_LoWord($iwParam) Local $iCode = _WinAPI_HiWord($iwParam) Local $sInput, $aPosCtrl, $aPosWin Switch $ilParam Case $hInput Switch $iCode Case $EN_SETFOCUS ControlClick($hGUI, "", $iInput, "", 1, 1) Case $EN_CHANGE $sInput = GUICtrlRead($iInput) If StringLen($sInput) > 22 Then $aPosWin = WinGetPos($hGUI) $aPosCtrl = ControlGetPos($hGUI, "", $iInput) ToolTip($sInput, -100 + $aPosWin[0] + $aPosCtrl[0], $aPosWin[1] + $aPosCtrl[1]) EndIf Case $EN_KILLFOCUS ToolTip("") EndSwitch EndSwitch Return "GUI_RUNDEFMSG" EndFunc ;==>WM_COMMAND Edit: forget it, I got you wrong -> new year hangover Edited January 1, 2016 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...
DickG Posted January 1, 2016 Author Share Posted January 1, 2016 DickG,Or perhaps like this:#include <GUIConstantsEx.au3> $sText = "A nice long string to get the input scrolled to the right" $hGUI = GUICreate("Test", 500, 500) $cInput = GUICtrlCreateInput($sText, 10, 10, 200, 20) GUISetState() ControlSend($hGUI, "", $cInput, "{HOME}") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndM23Thanks, Melba. I tried it, but couldn't get it to work. I must be doing something wrong because your sample does indeed work. But the _GUICtrlEdit_SetSel() command works for me, so I'll be using that. Link to comment Share on other sites More sharing options...
mikell Posted January 1, 2016 Share Posted January 1, 2016 #include <GUIConstantsEx.au3> #include <EditConstants.au3> $sText = "A nice long string to get the input scrolled to the right" $hGUI = GUICreate("Test", 300, 100) $cInput = GUICtrlCreateInput($sText, 10, 10, 200, 20) GUISetState() GuiCtrlSendMsg($cInput, $EM_SETSEL, 0, 0) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Xandy 1 Link to comment Share on other sites More sharing options...
DickG Posted January 2, 2016 Author Share Posted January 2, 2016 #include <GUIConstantsEx.au3> #include <EditConstants.au3> $sText = "A nice long string to get the input scrolled to the right" $hGUI = GUICreate("Test", 300, 100) $cInput = GUICtrlCreateInput($sText, 10, 10, 200, 20) GUISetState() GuiCtrlSendMsg($cInput, $EM_SETSEL, 0, 0) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndAwesome!GuiCtrlSendMsg($cInput, $EM_SETSEL, 0, 0) also works great! Now I have two great ways to do this!Thanks much, mikell! 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