Multiline input

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
boiler
Posts: 17328
Joined: 21 Dec 2014, 02:44

Re: Multiline input

Post by boiler » 03 Aug 2023, 01:14

Put the directive on the line before it as shown:

Code: Select all

#IfWinNotActive ahk_class #32770
Esc::Gui, IBML:Cancel

lionpack
Posts: 14
Joined: 27 Jul 2023, 14:45

Re: Multiline input

Post by lionpack » 03 Aug 2023, 12:17

Esc key is now not working for anything else on Windows --but it works to close the dialog

Thank you!

User avatar
boiler
Posts: 17328
Joined: 21 Dec 2014, 02:44

Re: Multiline input

Post by boiler » 03 Aug 2023, 12:43

Note the addition of the global line inside the function and the change to the directive line before the hotkey.

Code: Select all

InputBox, Name, Name, Enter your name:,, 385, 145
MsgBox, % Name

MsgBox, % InputBoxML("Enter your address:", "Address", 3)
return

InputBoxML(prompt="", title="", rows=2, width=200) {
	static IbmlEntry
	global IbmlID
	Gui, IBML:+ToolWindow +hwndIbmlID
	Gui, IBML:Add, Text,, % prompt
	Gui, IBML:Add, Edit, % "vIbmlEntry xm r" rows " w" width
	Gui, IBML:Add, Button, % "gIbmlSubmit xm+" width/2-25 " w50", Submit
	Gui, IBML:Show,, % title
	
	WinWaitClose, ahk_id %IbmlID%
	Gui, IBML:Destroy
	return IbmlEntry

	IbmlSubmit:
		Gui, IBML:Submit
	return
}

#If WinActive("ahk_id" IbmlID)
Esc::Gui, IBML:Cancel

lionpack
Posts: 14
Joined: 27 Jul 2023, 14:45

Re: Multiline input

Post by lionpack » 07 Apr 2024, 19:51

Hi,

After entering text in the dialog box and pressing TAB to go to the OK button --it sometimes goes to the CANCEL button instead first, how can I make it so TAB always goes to the OK button first

Code: Select all

	Gui, IBML:Add, Button, % "gIbmlOK xm+" width/2-65 " w50", OK
	Gui, IBML:Add, Button, gIbmlCancel x+30 w50, Cancel
Thank you!

User avatar
V0RT3X
Posts: 247
Joined: 20 May 2023, 21:59
Contact:

Re: Multiline input

Post by V0RT3X » 07 Apr 2024, 20:19

Per the documentation... look at Default.

https://www.autohotkey.com/docs/v1/lib/GuiControls.htm#Button

Post Reply

Return to “Ask for Help (v1)”