Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Requires AutoHotkey v2.0
- #SingleInstance Force
- MyGui := Gui("+Resize -MaximizeBox -MinimizeBox", "Options Selector")
- MyGui.SetFont("s10", "Segoe UI")
- MyGui.Add("Text", "x20 y20", "Select an option:")
- OptionsDDL := MyGui.Add("DropDownList", "x150 y18 w200", ["Option 1", "Option 2", "Option 3"])
- OptionsDDL.OnEvent("Change", (Ctrl, *) => DisplaySelection(Ctrl.Text))
- DisplayText := MyGui.Add("Text", "x20 y70 w500 h50 Border", "Your selection will appear here...")
- MyGui.Add("Button", "x150 y140 w80 h30", "Reset").OnEvent("Click", (*) => OptionsDDL.Value := "")
- MyGui.Add("Button", "x250 y140 w80 h30", "Submit").OnEvent("Click", (*) => SubmitSelection(OptionsDDL.Text))
- MyGui.Show("w540 h200 Center")
- DisplaySelection(Text) {
- DisplayText.Value := "Currently Selected: " Text
- }
- SubmitSelection(Text) {
- DisplayText.Value := "You have submitted: " Text
- }
- Numpad2::Reload
- Numpad0::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement