KillingEye Posted December 27, 2008 Posted December 27, 2008 Hi, Need help with Checkboxes: Description: When a checkbox get "checked" a InputBox opens. <- work When a checkbox get unchecked it should NOT open a Inputbox, but when i unheck the checkbox the damn Inputbox opens My Code: $Herooff = GuiCtrlCreateCheckbox("Hero", 30, 240, 130);checkbox Case $msg = $Herooff $InputHerooff = InputBox("Hero", "Hero?") Iniwrite("off.ini", "Truppen", "Hero", $InputHerooff) It is not the whole Code... only a little part.
CodyBarrett Posted December 27, 2008 Posted December 27, 2008 the Case statement *imprettysure* only means if it is Checked\Unchecked (both) so maybe try if $msg = $Herooff then $InputHerooff = InputBox("Hero", "Hero?") Iniwrite("off.ini", "Truppen", "Hero", $InputHerooff) endif OR if $herooff = '4' then ;meaning if it is OFF; $InputHerooff = InputBox("Hero", "Hero?") Iniwrite("off.ini", "Truppen", "Hero", $InputHerooff) endif OR if $herooff = '1' then ;meaning if it is ON; $InputHerooff = InputBox("Hero", "Hero?") Iniwrite("off.ini", "Truppen", "Hero", $InputHerooff) endif [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
KillingEye Posted December 27, 2008 Author Posted December 27, 2008 (edited) Is the "OR" Part of the Code? Edited December 27, 2008 by KillingEye
CodyBarrett Posted December 27, 2008 Posted December 27, 2008 sorry bout that, no it is not P: [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
FireFox Posted December 27, 2008 Posted December 27, 2008 @bob00037 KillingEye would understand if you put codes for scripts : if $msg = $Herooff then $InputHerooff = InputBox("Hero", "Hero?") Iniwrite("off.ini", "Truppen", "Hero", $InputHerooff) endif OR if $herooff = '4' then;meaning if it is OFF; $InputHerooff = InputBox("Hero", "Hero?") Iniwrite("off.ini", "Truppen", "Hero", $InputHerooff) endif OR if $herooff = '1' then;meaning if it is ON; $InputHerooff = InputBox("Hero", "Hero?") Iniwrite("off.ini", "Truppen", "Hero", $InputHerooff) endif Cheers, FireFox.
CodyBarrett Posted December 27, 2008 Posted December 27, 2008 yeha thats what i ment lol, i should sstart using code brakets more... andyway you cloud try those NOT THE 'OR' lol and if neither work then idk [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
KillingEye Posted December 27, 2008 Author Posted December 27, 2008 thank you for this help... but it does not work... now there appears no Inputbox o_O
TurionAltec Posted December 27, 2008 Posted December 27, 2008 (edited) $msg will = $herooff when it is checked or unchecked (because in a GUI you might want it to show elements when checked, and hide elements when unchecked $hereoff is always going to be constant, as it's the controlID. So checking it against other values won't do anything GUICtrlRead($Herooff) will tell you if it's checked or not. It will equal 1 if checked, 0 if unchecked. Case $msg = $Herooff AND GUICtrlRead($Herooff)=1 $InputHerooff = InputBox("Hero", "Hero?") Iniwrite("off.ini", "Truppen", "Hero", $InputHerooff) Edited December 27, 2008 by TurionAltec
KillingEye Posted December 27, 2008 Author Posted December 27, 2008 It Works :D:D Thank you!!! bob00037: Thank you also for your help
CodyBarrett Posted December 27, 2008 Posted December 27, 2008 lol no problem ps i thought unchecked = 4 and checked =1 thats what my msgbox(0,'',guictrlread()) says [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
TurionAltec Posted December 27, 2008 Posted December 27, 2008 lol no problem ps i thought unchecked = 4 and checked =1 thats what my msgbox(0,'',guictrlread()) saysYou're right! I shouldn't have been so sloppy. Plus it could be reporting if it has focus, so we should do a BitAnd. If we include <GUIConstantsEx.au3>: $GUI_UNCHECKED=4 $GUI_CHECKED =1 So we could code it in as: Case $msg = $Herooff AND BitAnd(GUICtrlRead($Herooff),$GUI_CHECKED)=$GUI_CHECKED $InputHerooff = InputBox("Hero", "Hero?") Iniwrite("off.ini", "Truppen", "Hero", $InputHerooff)
CodyBarrett Posted December 27, 2008 Posted December 27, 2008 looks good to me [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now