seesoe Posted September 4, 2009 Posted September 4, 2009 (edited) hello, how can i flash a labels background color, lets say every 1 second for example, red black red black red black..... Edited September 4, 2009 by seesoe
Yashied Posted September 4, 2009 Posted September 4, 2009 (edited) hello, how can i flash a labels background color, lets say every 1 second for example, red black red black red black..... Global $iPos = 0 Dim $aColor[2] = [0xFF0000, 0x000000] GUICreate('MyGUI', 200, 100) $Label = GUICtrlCreateLabel('My flash label', 10, 10, 66, 16) GUICtrlSetColor(-1, 0xFFFFFF) _Flash() GUISetState() AdlibEnable('_Flash', 1000) Do Until GUIGetMsg() = -3 Func _Flash() $iPos = 1 - $iPos GUICtrlSetBkColor($Label, $aColor[$iPos]) EndFunc ;==>_Flash Edited September 4, 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...
seesoe Posted September 4, 2009 Author Posted September 4, 2009 thank you very much:) a little more complex than i imagined but fair enough expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include 'CommMG.au3' #Region ### START Koda GUI section ### Form=c:\users\waseem\autoit projects\koda 1.7.2.0\forms\form1.kxf $Form1 = GUICreate("Serial Switch", 186, 216, 455, 354) $com_port_label = GUICtrlCreateLabel("COM Port Number", 24, 32, 90, 17) $com_port = GUICtrlCreateInput("1", 120, 28, 41, 21) $group_con = GUICtrlCreateGroup("Connection", 8, 72, 169, 65) GUICtrlCreateGroup("", -99, -99, 1, 1) $group_settings = GUICtrlCreateGroup("Settings", 8, 8, 169, 57) GUICtrlCreateGroup("", -99, -99, 1, 1) $activate = GUICtrlCreateButton("Activate Serial Switch Box", 16, 96, 147, 25, 0) $group_stat = GUICtrlCreateGroup("Status", 8, 144, 169, 65) $barcode = GUICtrlCreateLabel("Barcode", 24, 168, 63, 25, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetBkColor(-1, 0x00FF00) $data_link = GUICtrlCreateLabel("Data Link", 96, 168, 63, 25, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetBkColor(-1, 0xC0C0C0) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $iPos = 0 Dim $aColor[2] = [0xFFFF00, 0xC0C0C0] _Flash() Func _Flash() $iPos = 1 - $iPos GUICtrlSetBkColor($data_link, $aColor[$iPos]) EndFunc $connected = False While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then if $connected = True Then _Commcloseport() EndIf Exit EndIf If $msg = $activate Then If Not $connected Then Local $sportSetError If _CommSetPort(GUICtrlRead($com_port),$sportSetError, 4800, 8, 0, 1, 0) Then $connected = True AdlibEnable('_Flash', 300) GUICtrlSetBkColor($barcode, 0xC0C0C0) GUICtrlSetData($activate, "Deactivate Serial Switch Box") Else $connected = True AdlibEnable('_Flash', 300) GUICtrlSetBkColor($barcode, 0xC0C0C0) GUICtrlSetData($activate, "Deactivate Serial Switch Box") EndIf Else $connected = False AdlibDisable ( ) GUICtrlSetBkColor($data_link, 0xC0C0C0) GUICtrlSetBkColor($barcode, 0x00FF00) GUICtrlSetData($activate, "Activate Serial Switch Box") _Commcloseport() EndIf EndIf WEnd
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