Modify

Opened 9 years ago

Closed 9 years ago

#3119 closed Bug (No Bug)

GUICtrlSetColor bug

Reported by: lemonxtt Owned by:
Milestone: Component: AutoIt
Version: 3.3.14.0 Severity: None
Keywords: Cc:

Description

remarks Help file of GUICtrlSetColor: "Only Button, Group, ... can currently be colored" but my code:
GUICtrlCreateGroup("Example", 8, 8, 265, 265)
GUICtrlSetColor(-1, $color_blue)

after run, "Example" still black, i think GUICtrlSetColor not work for Group

ps: My Windows is Win 7 and not "Windows XP/Vista style"

Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by mLipok

What you mean not work ?

#include <GUIConstantsEx.au3>
#include <ColorConstants.au3>
Example()

Func Example()
	GUICreate("My GUI group") ; will create a dialog box that when displayed is centered

	GUICtrlCreateGroup("Group 1", 190, 60, 90, 140)
	GUICtrlSetColor(-1, $color_blue)
	GUICtrlSetBkColor(-1, $COLOR_RED)
	GUICtrlSetBkColor(-1, $COLOR_GREEN)
	GUICtrlCreateRadio("Radio 1", 210, 90, 50, 20)
	GUICtrlCreateRadio("Radio 2", 210, 110, 60, 50)
	GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

	GUISetState(@SW_SHOW) ; will display an empty dialog box

	; Loop until the user exits.
	While 1
		Switch GUIGetMsg()
			Case $GUI_EVENT_CLOSE
				ExitLoop
		EndSwitch
	WEnd
EndFunc   ;==>Example

comment:2 Changed 9 years ago by Melba23

  • Resolution set to No Bug
  • Status changed from new to closed

But to colour the text, rather than the background, you need to remove the style - as the Help file explains:

#include <GUIConstantsEx.au3>
#include <ColorConstants.au3>
Example()

Func Example()
	GUICreate("My GUI group") ; will create a dialog box that when displayed is centered

	$cGroup = GUICtrlCreateGroup("Group 1", 190, 60, 90, 140)
	DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($cGroup), "wstr", 0, "wstr", 0)
	GUICtrlSetColor(-1, $COLOR_RED)
	GUICtrlSetBkColor(-1, $COLOR_GREEN)
	GUICtrlCreateRadio("Radio 1", 210, 90, 50, 20)
	GUICtrlCreateRadio("Radio 2", 210, 110, 60, 50)
	GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

	GUISetState(@SW_SHOW) ; will display an empty dialog box

	; Loop until the user exits.
	While 1
		Switch GUIGetMsg()
			Case $GUI_EVENT_CLOSE
				ExitLoop
		EndSwitch
	WEnd
EndFunc   ;==>Example

No bug.

M23

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.