Schlumpf Posted September 29, 2006 Share Posted September 29, 2006 Moin,is it possible to make a XPstyle-Button with a red text? [CENTER]Sorry for my bad English... ;)[/CENTER] Link to comment Share on other sites More sharing options...
martin Posted September 29, 2006 Share Posted September 29, 2006 It's shown in the help file as an example for GUIRegisterMsg. You could also make your own image and use it as a button, but you might need 2 images so that the depressed state can be shown as well. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
dabus Posted September 29, 2006 Share Posted September 29, 2006 (edited) Not tested, but SmOke_N posted this, so it should be ok... Please use the search... +color +button has some hits expandcollapse popup#include <GUIConstants.au3> GUICreate("Label disguised as a button"); will create a dialog box that when displayed is centered Opt("GUIOnEventMode",1) Dim $mylabel = GUICtrlCreateLabel ("Testing, one two three", 2, 2, 350,35, BitOR($BS_DEFPUSHBUTTON, $SS_SUNKEN, $BS_CENTER, $SS_LEFT), $SS_BLACKFRAME) GUICtrlSetColor(-1,0x082BFE);blue GUICtrlSetFont(-1,14,4,"","Arial") GUICtrlSetBkColor(-1,0xF8FA6F); Yellow GUICtrlSetOnEvent($mylabel, "_TestButton") GUISetOnEvent(- 3, 'ExitNow') GUISetState () ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 Sleep(10000) Wend Func _TestButton() $count = 1 While _IsPressed('01') If $count = 1 Then GUICtrlSetColor($mylabel,0xF8FA6F);blue GUICtrlSetFont($mylabel,14,4,"","Arial") GUICtrlSetBkColor($mylabel,0x082BFE); Yellow $count = $count + 1 EndIf WEnd GUICtrlSetColor($mylabel,0x082BFE);blue GUICtrlSetFont($mylabel,14,4,"","Arial") GUICtrlSetBkColor($mylabel,0xF8FA6F); Yellow EndFunc Func ExitNow() Exit EndFunc Func _IsPressed($s_hexKey, $v_dll = 'user32.dll') Local $a_R = DllCall($v_dll, "int", "GetAsyncKeyState", "int", '0x' & $s_hexKey) If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1 Return 0 EndFunc Edited September 29, 2006 by dabus Link to comment Share on other sites More sharing options...
Valuater Posted September 29, 2006 Share Posted September 29, 2006 (edited) might want to take a look at _ControlHover()Function Name: _ControlHover() ; Description: Enable Mouse/Hover Over Control Events ; Find if Mouse is over a known control ; Find if a Mouse has Clicked on a known controlhas a great demo too!http://www.autoitscript.com/forum/index.php?showtopic=332308) Edited September 29, 2006 by Valuater Link to comment Share on other sites More sharing options...
Schlumpf Posted September 30, 2006 Author Share Posted September 30, 2006 I'm trying to do this: is it possible? [CENTER]Sorry for my bad English... ;)[/CENTER] Link to comment Share on other sites More sharing options...
lod3n Posted October 2, 2006 Share Posted October 2, 2006 (edited) Yes:http://www.autoitscript.com/forum/index.php?showtopic=25077Well, kind of. XPstyle makes it impossible to do it the way you'd like. But you can get red text on a button, it just kind of sucks thanks to Microsoft. Edited October 2, 2006 by lod3n [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] 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