Onylove Posted November 1, 2009 Posted November 1, 2009 I don't know how to do it. When I move mouse over a picture on a GUI, the picture'll change to another picture. Could some one help me? Thanks so much Forever (freeze_love)Blog at: http://freeze_love.summerhost.info/
Yashied Posted November 1, 2009 Posted November 1, 2009 (edited) Icons.au3 => GUICtrlSetOnHover & Icons UDFs DemonstrationEDIT:Later I'll put an update for this library. Edited November 1, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Onylove Posted November 1, 2009 Author Posted November 1, 2009 Thanks for supplying. That's all I need. THank you Forever (freeze_love)Blog at: http://freeze_love.summerhost.info/
Malkey Posted November 1, 2009 Posted November 1, 2009 Another example. And for those who quenched their thirst on Yashied's link, I added the _Iif one-liner to make the script look a little bit more complicated. expandcollapse popup; #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <Misc.au3> Local $Msg, $GUI, $Pic1, $Pic2 $GUI = GUICreate("My GUI picture", 350, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) GUISetBkColor(0xE0FFFF) $Pic1 = GUICtrlCreatePic(@SystemDir & "\oobe\images\mslogo.jpg", 50, 50, 169, 68) GUICtrlSetState($Pic1, $GUI_SHOW) $Pic2 = GUICtrlCreatePic("C:\Program Files\AutoIt3\Examples\GUI\logo4.gif", 50, 50, 169, 68) GUICtrlSetState($Pic2, $GUI_SHOW) GUISetState() While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_MOUSEMOVE $aCursor = GUIGetCursorInfo() GUICtrlSetState($Pic2, _Iif(($aCursor[4] = $Pic2) And BitAND(GUICtrlGetState($Pic2), 16), $GUI_HIDE, _Iif($aCursor[4] <> $Pic1 And BitAND(GUICtrlGetState($Pic2), 32), $GUI_SHOW, 0))) ; The above one liner is the same (has same logic structure and does the same) as the below, commented out If - ElseIf - EndIf lines. #cs If ($aCursor[4] = $Pic2) And BitAND(GUICtrlGetState($Pic2), 16) Then GUICtrlSetState($Pic2, $GUI_HIDE) ElseIf $aCursor[4] <> $Pic1 And BitAND(GUICtrlGetState($Pic2), 32) Then GUICtrlSetState($Pic2, $GUI_SHOW) EndIf #ce Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ;
picea892 Posted November 2, 2009 Posted November 2, 2009 That is a neat trick Malkey. For me it really adds to the complexity of the script and I probably would defer to a function call instead. Certainly nice to know about in case I one day am at your skill level.
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