ComboBox List

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Pscx1
Posts: 4
Joined: 24 Jun 2020, 14:22

ComboBox List

Post by Pscx1 » 20 Oct 2021, 07:26

Hey,
I have some problem to figure out how I could make some list for combobox to just choose some position which has assigned values to that. Like 1Thing (n1=2, n2=3, n3= 23) etc. and it would fill variable *holes* in other math part of my code.

Any ideas?

Here is my code

https://p.ahkscript.org/?p=a5b7eb8a

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: ComboBox List

Post by mikeyww » 20 Oct 2021, 07:35

Code: Select all

Gui, Font, s10
Gui, Add, ComboBox, vnumber, 1|2|3||4
Gui, Add, Button, Default, Compute
Gosub, F3
F3::Gui, Show, w220, Compute

ButtonCompute:
Gui, Submit
twice := 2 * number
MsgBox, 64, Result for %number%, Result = %twice%`n`nAfter pressing OK, press F3 to show the GUI again.
Return

Pscx1
Posts: 4
Joined: 24 Jun 2020, 14:22

Re: ComboBox List

Post by Pscx1 » 20 Oct 2021, 07:54

I dont understand how it could help me make list with assigned constant numbers to "Thing1", "Thing2" etc just to choose them and autofill n1-n5 variables in math part

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: ComboBox List

Post by mikeyww » 20 Oct 2021, 08:58

It may help if you can describe a specific example here, step by step.

Pscx1
Posts: 4
Joined: 24 Jun 2020, 14:22

Re: ComboBox List

Post by Pscx1 » 20 Oct 2021, 11:32

I want to use combobox list to autofill those part

Code: Select all

Towary1 := n1+n2+n3+n4+n5   ; Suma towarów
Suma_towarów1 := Ceil(Towary1)

Towary3 := n1 + ((n2+n3+n4+n5)/2)   ; Wkład wymiennika netto
Suma_towarów3 := Ceil(Towary3)

Towary2 := ((Suma_towarów3)/2) + ((Suma_towarów3)/8) ; Wkład własny brutto
Suma_towarów2 := Ceil(Towary2)

Towary4 := n1 + ((n2+n3+n4+n5)/2) + ((Suma_towarów2)/2)   ; Wkład wymiennika brutto
Suma_towarów4 := Ceil(Towary4)

Wkład_własny := Ceil(Suma_towarów2)
Wkład_do_wymiany := Ceil(Suma_towarów4)
But i have no idea how i can make list for combobox other than just Red|Green|Blue, Want them to be like Red(n1=1, n2=2 ...) | Green(n1=2, n2=4...)
Just choose something from list with assigned numbers to them which will fill those n1-n5 things

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: ComboBox List

Post by mikeyww » 20 Oct 2021, 15:25

Code: Select all

n := [[1, 2], [2, 4]]
Gui, Font, s10
Gui, Add, ComboBox, vset AltSubmit, Red (n1=1, n2=2)||Green (n1=2, n2=4)
Gui, Add, Button, Default, Compute
Gosub, F3
F3::Gui, Show, w220, Compute

ButtonCompute:
Gui, Submit
MsgBox, 64, Result for selection #%set%, % n[set].1 + n[set].2
Return

Post Reply

Return to “Ask for Help (v1)”