lordicast Posted August 22, 2007 Posted August 22, 2007 (edited) I need help on the updown functions for example;Think of it as a remote control every time i press up or down on it i want it to run a function that equals a certain value automaticallyEX;channel 1 opens notepadchannel 2 opens calc channel 3 opens cmdany help on this would be appreciated Edited August 23, 2007 by lordicast [Cheeky]Comment[/Cheeky]
smashly Posted August 22, 2007 Posted August 22, 2007 (edited) Hi, Like this maybe..expandcollapse popupinclude <GUIConstants.au3> $Gui = GUICreate(":-)", 140, 40, -1, -1, -1, $WS_EX_TOPMOST) $Label = GUICtrlCreateLabel("", 11, 11, 99, 18, $SS_CENTER + $BS_CENTER) GUICtrlSetBkColor(-1, 0xffffff) $Input = GUICtrlCreateInput("", 10, 10, 120, 20, $ES_READONLY + $WS_CLIPSIBLINGS) GUICtrlSetBkColor(-1, 0xffffff) $UpDown = GUICtrlCreateUpdown($Input) GUICtrlSetLimit($UpDown, 4, -1) GUISetState(@SW_SHOW, $Gui) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $UpDown If StringLeft(GUICtrlRead($Input), 1) = "-" Then GUICtrlSetData($Input, 3) GUICtrlSetData($Label, "Open CMD") ShellExecute("cmd.exe") ElseIf GUICtrlRead($Input) = 0 Then GUICtrlSetData($Label, "") ElseIf GUICtrlRead($Input) = 1 Then GUICtrlSetData($Label, "Open Notepad") ShellExecute("notepad.exe") ElseIf GUICtrlRead($Input) = 2 Then GUICtrlSetData($Label, "Open Calc") ShellExecute("calc.exe") ElseIf GUICtrlRead($Input) = 3 Then GUICtrlSetData($Label, "Open CMD") ShellExecute("cmd.exe") ElseIf GUICtrlRead($Input) = 4 Then GUICtrlSetData($Input, 0) GUICtrlSetData($Label, "") EndIf EndSelect WEnd Cheers Edit: P.S. If your going to underline a word to give emphasis on meaning then how about spelling it correctly atuomaticallyautomatically Edited August 22, 2007 by smashly
lordicast Posted August 23, 2007 Author Posted August 23, 2007 Thanks for the script however, if you are going to edit my grammar you missed appreciated but I already corrected thanks to my handy dandy spell check button ;P [Cheeky]Comment[/Cheeky]
smashly Posted August 23, 2007 Posted August 23, 2007 Your welcome But I'm not the one underlining my spelling typo's Cheers
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