Aceguy Posted January 26, 2008 Share Posted January 26, 2008 when using a combo box, is there a way to update a label while selecting the contents of a combo box, (beofre confirming selection) many thanks [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
BrettF Posted January 26, 2008 Share Posted January 26, 2008 when using a combo box, is there a way to update a label while selecting the contents of a combo box, (beofre confirming selection) many thanksI did this in the shell comp... expandcollapse popup$shtdpwn = GUICreate("Shudown", 213, 183) $Label1 = GUICtrlCreateLabel("What would you like your computer to do?", 4, 4, 203, 17) $CboShutdown = GUICtrlCreateCombo("", 4, 28, 205, 25, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, "Exit|Standby|Shutdown|Reboot|Hibernate", "Exit") $lblabout = GUICtrlCreateLabel("Exits this program", 4, 80, 203, 50) $btnOK = GUICtrlCreateButton("OK", 132, 152, 75, 25) GUICtrlSetState(-1, $GUI_DEFBUTTON) $btnCancel = GUICtrlCreateButton("Cancel", 52, 152, 75, 25) $chkForce = GUICtrlCreateCheckbox("Force", 4, 56, 201, 17) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $CboShutdown Or $msg = $chkForce $Shutdown = GUICtrlRead($CboShutdown) Select Case $Shutdown = "Exit" $code = "Exits this program" Case $Shutdown = "Standby" $code = "Will send the computer into Standby Mode" Case $Shutdown = "Shutdown" $code = "Will shutdown this computer" Case $Shutdown = "Reboot" $code = "Will restart this computer" Case $Shutdown = "Hibernate" $code = "Will hibernate this computer, saving the current settings." EndSelect If GUICtrlRead($chkForce) = $GUI_CHECKED Then $code += @CRLF & @CRLF & "Force the current action" EndIf GUICtrlSetData($lblabout, $code) Case $msg = $btnOK $Shutdown = GUICtrlRead($CboShutdown) $code = 0 Select Case $Shutdown = "Exit" $code = 0 Case $Shutdown = "Standby" $code = 32 Case $Shutdown = "Shutdown" $code = 1 Case $Shutdown = "Reboot" $code = 2 Case $Shutdown = "Hibernate" $code = 64 EndSelect If GUICtrlGetState($chkForce) = $GUI_CHECKED Then $code += 4 EndIf If $code = 0 Then Exit Else MsgBox(0, "", "SHUTDOWN: " & $code) ;Shutdown ($code) Exit EndIf Case $msg = $btnCancel ExitLoop EndSelect WEnd GUIDelete($shtdpwn) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
erezlevi Posted January 26, 2008 Share Posted January 26, 2008 don't forget to put #include <GUIconstants.au3> at the begining, but it is great Example as allways bret you are amaizing! Link to comment Share on other sites More sharing options...
BrettF Posted January 26, 2008 Share Posted January 26, 2008 (edited) don't forget to put #include <GUIconstants.au3> at the begining, but it is great Example as allways bret you are amaizing!And remember that you will have to use specific constants in future versions. GUIConstants.au3 will be "deflated" soon... or something like that... Erm... Thanks?? Edited January 26, 2008 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Aceguy Posted January 26, 2008 Author Share Posted January 26, 2008 thanks for quick reply, Altho im after it udating whats under the mouse pointer . ie. click combo to bring list up, using mouse pointer to update the $label to whats under the mouse.? [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
BrettF Posted January 26, 2008 Share Posted January 26, 2008 thanks for quick reply, Altho im after it udating whats under the mouse pointer .ie.click combo to bring list up, using mouse pointer to update the $label to whats under the mouse.?Mate, you making about as much sense a kookaburra. I don't understand what you are asking. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
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