orbs Posted September 14, 2013 Share Posted September 14, 2013 hello all, i create a graphic rectangle, then i place a label in it. i can change the label font weight and background color, but i can not change the label text color. this is a small reproducer: #include <GUIConstantsEx.au3> GUICreate('Block demo',400,200) GUISetBkColor(0xCCDDEE) GUICtrlCreateBlock('Title Of Block',20,20,300,100) GUICtrlCreateLabel('Text Inside Block',25,50) GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) GUISetState() Global $msg=0 While $msg<>$GUI_EVENT_CLOSE $msg=GUIGetMsg() WEnd Func GUICtrlCreateBlock($sTitle,$x,$y,$w,$h) Local Const $cOutline=0x000000 Local Const $cBlockBG=0xFFFFFF Local Const $cTitle=0x0000EE Local Const $cTitleBG=0x999999 GUICtrlCreateGraphic($x-1,$y-1,$w+2,$h+2) GUICtrlSetState(-1,$GUI_DISABLE) GUICtrlSetGraphic(-1,$GUI_GR_COLOR,$cOutline,$cTitleBG) GUICtrlSetGraphic(-1,$GUI_GR_RECT,-1,-1,$w+2,27) GUICtrlSetGraphic(-1,$GUI_GR_COLOR,$cOutline,$cBlockBG) GUICtrlSetGraphic(-1,$GUI_GR_RECT,-1,25,$w+2,$h+2-25) GUICtrlCreateLabel($sTitle,$x+5,$y+3,$w-10,20) GUICtrlSetFont(-1,8.5,800) GUICtrlSetColor(-1,$cTitle) GUICtrlSetBkColor(-1,$cTitleBG) GUICtrlSetState(-1,$GUI_DISABLE) EndFunc this is the result: the label text color is shady white, while it should be blue: what am i doing wrong? Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
Solution HeJake Posted September 14, 2013 Solution Share Posted September 14, 2013 U forgot to change GUICtrlSetState(-1,$GUI_DISABLE) to GUICtrlSetState(-1,$GUI_ENABLE) #include <GUIConstantsEx.au3> GUICreate('Block demo',400,200) GUISetBkColor(0xCCDDEE) GUICtrlCreateBlock('Title Of Block',20,20,300,100) GUICtrlCreateLabel('Text Inside Block',25,50) GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) GUISetState() Global $msg=0 While $msg<>$GUI_EVENT_CLOSE $msg=GUIGetMsg() WEnd Func GUICtrlCreateBlock($sTitle,$x,$y,$w,$h) Local Const $cOutline=0x000000 Local Const $cBlockBG=0xFFFFFF Local Const $cTitle=0x0000EE Local Const $cTitleBG=0x999999 GUICtrlCreateGraphic($x-1,$y-1,$w+2,$h+2) GUICtrlSetState(-1,$GUI_DISABLE) GUICtrlSetGraphic(-1,$GUI_GR_COLOR,$cOutline,$cTitleBG) GUICtrlSetGraphic(-1,$GUI_GR_RECT,-1,-1,$w+2,27) GUICtrlSetGraphic(-1,$GUI_GR_COLOR,$cOutline,$cBlockBG) GUICtrlSetGraphic(-1,$GUI_GR_RECT,-1,25,$w+2,$h+2-25) GUICtrlCreateLabel($sTitle,$x+5,$y+3,$w-10,20) GUICtrlSetFont(-1,8.5,800) GUICtrlSetColor(-1,$cTitle) GUICtrlSetBkColor(-1,$cTitleBG) GUICtrlSetState(-1,$GUI_ENABLE) EndFunc Link to comment Share on other sites More sharing options...
orbs Posted September 15, 2013 Author Share Posted September 15, 2013 force of habit i guess, i usually disable all objects if they are not supposed to be clicked... thank you! Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff 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