sandin Posted October 5, 2007 Share Posted October 5, 2007 how can I make some labels change colors if I move my mouse over them, for example I would like to know how to change colors of the "X" and "_" labes if I move my mouse over them: expandcollapse popup#include <GUIConstants.au3> Const $HTCAPTION = 2 Const $WM_NCLBUTTONDOWN = 0xA1 Opt("GUIOnEventMode",1) $formtitle = "" $Form1 = GUICreate($formtitle, 271, 154, 239, 132, $WS_POPUPWINDOW) GUISetBkColor (0x292929) $Label1 = GUICtrlCreateLabel("Title", 8, 0, 17, 17) GUICtrlSetColor(-1, 0xeedd82) GUICtrlSetFont (-1,12, 800, 2, "Arial") $Label2 = GUICtrlCreateLabel("_", 235, 0, 17, 17) GUICtrlSetColor(-1, 0xeedd82) GUICtrlSetFont (-1,12, 800, Default, "Arial") $Label3 = GUICtrlCreateLabel("x", 255, 0, 43, 17) GUICtrlSetColor(-1, 0xeedd82) GUICtrlSetFont (-1,12, 800, Default, "Arial") GUISetOnEvent ($GUI_EVENT_CLOSE, "Quit" ) GUISetOnEvent ($GUI_EVENT_PRIMARYDOWN, "Drag" ) GUICtrlSetOnEvent($Label2, "_minimize") GUICtrlSetOnEvent($Label3, "Quit") GUISetState(@SW_SHOW) func _minimize () GUISetState(@SW_MINIMIZE) EndFunc Func Drag() dllcall("user32.dll","int","SendMessage","hWnd", $Form1,"int",$WM_NCLBUTTONDOWN,"int", $HTCAPTION,"int", 0) EndFunc Func Quit() Exit EndFunc While 1 Sleep(10) WEnd Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
Nahuel Posted October 5, 2007 Share Posted October 5, 2007 expandcollapse popup#include <GUIConstants.au3> #include<_ControlHover.au3> Const $HTCAPTION = 2 Const $WM_NCLBUTTONDOWN = 0xA1 Opt("GUIOnEventMode",1) $formtitle = "" $Form1 = GUICreate($formtitle, 271, 154, 239, 132, $WS_POPUPWINDOW) GUISetBkColor (0x292929) $Label1 = GUICtrlCreateLabel("Title", 8, 0, 17, 17) GUICtrlSetColor(-1, 0xeedd82) GUICtrlSetFont (-1,12, 800, 2, "Arial") $Label2 = GUICtrlCreateLabel(" _", 235, 0, 17, 17) GUICtrlSetColor(-1, 0xeedd82) GUICtrlSetFont (-1,12, 800, Default, "Arial") $Label3 = GUICtrlCreateLabel("X", 255, 0, 43, 17) GUICtrlSetColor(-1, 0xeedd82) GUICtrlSetFont (-1,12, 800, Default, "Arial") GUISetOnEvent ($GUI_EVENT_CLOSE, "Quit" ) GUISetOnEvent ($GUI_EVENT_PRIMARYDOWN, "Drag" ) GUICtrlSetOnEvent($Label2, "_minimize") GUICtrlSetOnEvent($Label3, "Quit") GUISetState(@SW_SHOW) _ControlHover(2, "", $Label2) _ControlHover(2, "", $Label3) While 1 Sleep(10) $Over = _ControlHover(0, $Form1) If $Over = 1 Then If @extended = $Label2 Then GUICtrlSetBkColor($Label2, 0xF7F721) Else If @extended = $Label3 Then GUICtrlSetBkColor($Label3, 0xFF0000) Else GUICtrlSetBkColor($Label3, 0x000000) GUICtrlSetBkColor($Label2, 0x000000) EndIf EndIf EndIf WEnd func _minimize () GUISetState(@SW_MINIMIZE) EndFunc Func Drag() dllcall("user32.dll","int","SendMessage","hWnd", $Form1,"int",$WM_NCLBUTTONDOWN,"int", $HTCAPTION,"int", 0) EndFunc Func Quit() Exit EndFuncPS. You will need _ControlHover.au3 Link to comment Share on other sites More sharing options...
sandin Posted October 5, 2007 Author Share Posted October 5, 2007 thank you Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll 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