GUI - a + button adds another textbox in its place

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
RyanAyton
Posts: 49
Joined: 14 Aug 2017, 09:53

GUI - a + button adds another textbox in its place

23 Feb 2018, 16:43

Hello

How would you go about having a + button add a new textbox in to the gui?

The reason for this is because I want the end user to be able to put in additional field(s) if it's needed.

Also say if this is possible, could it also automatically extend the gui window - or scrollable - in case the end user needs to add in a lot?

Many Thanks
User avatar
boiler
Posts: 16932
Joined: 21 Dec 2014, 02:44

Re: GUI - a + button adds another textbox in its place

23 Feb 2018, 18:53

I assume by text box you mean an edit box. Here's a basic approach to it. Making it scrollable is more advanced. There have been various threads about it on the forum that you should be able to find.

Code: Select all

EditCount := 1
gosub, BuildGui
return

GuiClose:
ExitApp

AddEdit:
	EditCount++
	gosub, BuildGui
return

BuildGui:
	Gui, Destroy
	loop, %EditCount%
		Gui, Add, Edit, w200 vEdit%A_Index%
	Gui, Add, Button, gAddEdit w200, +
	Gui, Show
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 371 guests