Msgbox2 - customizable msgbox - 2020/07/31 - a121

Share the finished AutoHotkey v2 Scripts and libraries you made here. Please put the current version of AutoHotkey v2 you used in Square Brackets at the start of the topic title.
User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Msgbox2 - customizable msgbox - 2020/07/31 - a121

Post by TheArkive » 31 Jul 2020, 06:04

Thanks to @robodesign for LOTS of collaboration, testing, and feedback. This is definitely a joint project.
Thanks to @just me for making TaskDialog which gave me some ideas in a few places I got stuck.

This class enhances and combines the Msgbox and InputBox commands. Now you have a quick and simple solution to add as many custom buttons as you want to a Msgbox. Or you can configure this to have input controls, including any combination of an Edit box, DropDownList, ComboBox, CheckBox, or ListBox. Each of these controls can be populated and have a value pre-selected. This class actually halts the current function or thread to wait for input from the user as expected by a MsgBox / InputBox command.

EDIT: You can also change the font!!

After the user interacts with or closes the dialog, the following properties are populated:

Code: Select all

.list             row number selected in ListBox
.listText         text of row number selected in Listbox
.dropList         row number selected in DropDownList
.dropListText     text of row number selected in DropDownList
.combo            row number selected in ComboBox
.comboText        text of row number selected in ComboBox
.check            value of Checkbox (1 or 0 / true or false)
.button           text of the button clicked
.ClassNN          ClassNN of the button clicked
msgbox2 demo.png
msgbox2 demo.png (8.51 KiB) Viewed 412 times
===========================================================================
Changes:
===========================================================================

:arrow: Download on GitHub
Last edited by TheArkive on 20 Aug 2020, 02:11, edited 1 time in total.

User avatar
Tigerlily
Posts: 353
Joined: 04 Oct 2018, 22:31

Re: Msgbox2 - customizable msgbox - 2020/07/31 - a121

Post by Tigerlily » 19 Aug 2020, 16:52

@TheArkive

Very cool, I will definitely test these out and report back sometime! This should be built into AHK imo. Nice!
-TL

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: Msgbox2 - customizable msgbox - 2020/07/31 - a121

Post by TheArkive » 20 Aug 2020, 02:12

@Tigerlily
Thanks :)
You can also change the font / font size with this class script. Forgot to mention that in the description (now updated).

Post Reply

Return to “AutoHotkey v2 Scripts and Functions”