|
You last visited: Today at 11:34
Advertisement
plz help
Discussion on plz help within the AutoIt forum part of the Coders Den category.
09/16/2015, 18:13
|
#1
|
elite*gold: 0
Join Date: Jan 2015
Posts: 6
Received Thanks: 0
|
plz help
Code:
#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 319, 216, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox(" 1", 48, 56, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox(" 2", 48, 88, 97, 17)
$Checkbox3 = GUICtrlCreateCheckbox(" 4", 48, 120, 97, 17)
$Checkbox4 = GUICtrlCreateCheckbox(" 8", 216, 56, 97, 17)
$Checkbox5 = GUICtrlCreateCheckbox("16", 216, 88, 97, 17)
$Checkbox6 = GUICtrlCreateCheckbox(" 32", 216, 120, 97, 17)
$Button1 = GUICtrlCreateButton("plus any checked boxes", 64, 160, 155, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button1
????????????????????????????????????????????????????????; show result of plus checked boxes in message
EndSwitch
WEnd
|
|
|
09/16/2015, 20:49
|
#2
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
I don't know whats worse, the fact that your title is garbage or the fact that you don't give a **** about rules >>
|
|
|
09/16/2015, 21:16
|
#3
|
elite*gold: LOCKED
Join Date: Oct 2014
Posts: 1,258
Received Thanks: 12,470
|
Well, its not the best usage but you could make an if statement for every checkbox, read it, add into a variable and etc.
I guess this is what you are asking for.
Code:
#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 319, 216, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("1", 48, 56, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("2", 48, 88, 97, 17)
$Checkbox3 = GUICtrlCreateCheckbox("4", 48, 120, 97, 17)
$Checkbox4 = GUICtrlCreateCheckbox("8", 216, 56, 97, 17)
$Checkbox5 = GUICtrlCreateCheckbox("16", 216, 88, 97, 17)
$Checkbox6 = GUICtrlCreateCheckbox("32", 216, 120, 97, 17)
$Button1 = GUICtrlCreateButton("plus any checked boxes", 64, 160, 155, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$plus = 0
$plus = CheckCheckbox($Checkbox1,$plus)
$plus = CheckCheckbox($Checkbox2,$plus)
$plus = CheckCheckbox($Checkbox3,$plus)
$plus = CheckCheckbox($Checkbox4,$plus)
$plus = CheckCheckbox($Checkbox5,$plus)
$plus = CheckCheckbox($Checkbox6,$plus)
MsgBox(64,"Calculated",$plus)
EndSwitch
WEnd
Func CheckCheckbox($Control,$Before)
If GUICtrlRead($Control) = 1 Then
$res = GUICtrlRead($Control,1)
Else
$res = 0
EndIf
Return $res + $Before
EndFunc
|
|
|
09/17/2015, 04:15
|
#4
|
elite*gold: 0
Join Date: Jan 2015
Posts: 6
Received Thanks: 0
|
thanks my sir
|
|
|
09/17/2015, 10:41
|
#5
|
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
|
Quote:
- Scriptrequests: Do ask for scripts there:
- If you have a little question you have to ask there:
- Thread with titels like: "Help!!", "Problem", "Question?!", "Autoit Question" are forbidden.
|
#closed
|
|
|
All times are GMT +2. The time now is 11:34.
|
|