Jump to content
Sign in to follow this  

Input Select All

Recommended Posts


In the following script I'm trying to use the keyboard key combination ctrl+a to select all of the contents in input box 3. Nothing happens after I click inside input box 3 and type ctrl+a. How can I use ctrl+a to select all the contents in input box 3?

#include <GUIConstantsEx.au3>

Opt("GUIOnEventMode", 1)  ; Change to OnEvent mode
$mWinTitle = "Test Copy Input"
$mainwindow = GUICreate($mWinTitle, 300, 150)
GUICtrlCreateLabel("Input Label 1", 10, 10)
GUICtrlCreateLabel("Input Label 2", 10, 50)

$ipt1 = GUICtrlCreateInput("Input 1 Test", 80, 10, 215, 20)
$ipt2 = GUICtrlCreateInput("Input 2 Test", 80, 50, 215, 20)

$ipt3 = GUICtrlCreateInput("", 5, 75, 290, 20)
GUICtrlSetState($ipt3, $GUI_DEFBUTTON)

$btn1 = GUICtrlCreateButton("Btn1", 175, 115, 60)
GUICtrlSetOnEvent($btn1, "")

$btn2 = GUICtrlCreateButton("Btn2", 235, 115, 60)
GUICtrlSetOnEvent($btn2, "")

$dummywindow = GUICreate("Dummy window for testing ", 200, 100)

WinSetOnTop($mainwindow, "", 1)

GUICtrlSetData($ipt3, GUICtrlRead($ipt1) & " ---- " & GUICtrlRead($ipt2))

While 1
  Sleep(1000)  ; Idle around

Func InsertBtn()
  ;Note: at this point @GUI_CTRLID would equal $okbutton
  ;MsgBox(0, "GUI Event", "You pressed Insert!")

Func CLOSEClicked()
  ;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE,
  ;@GUI_WINHANDLE will be either $mainwindow or $dummywindow
  If @GUI_WINHANDLE = $mainwindow Then 
    ;MsgBox(0, "GUI Event", "You clicked CLOSE in the main window! Exiting...")
EndFunc     ;==>CLOSEDClicked

Thank you for your help,


Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Share this post

Link to post
Share on other sites

Try making them Edit controls (set styles to remove scroll bars). I think the Windows API for that control type will do it for you.


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.