Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1208 closed Bug (No Bug)

No colored flat Button possible

Reported by: funkey Owned by:
Milestone: Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: Cc:

Description (last modified by Valik)

Either a flat button or a colored button is possible, not both.

#include <ButtonConstants.au3>

Opt("GUIOnEventMode", 1)

GUICreate("Button-Bug", 200, 110)
GUISetOnEvent(-3, "_Exit")

GUICtrlCreateButton("Flat", 20, 20, 70, 20, $BS_FLAT)
GUICtrlSetBkColor(-1, 0xFF0000)
GUICtrlSetStyle(-1, $BS_FLAT)

GUICtrlSetOnEvent(-1, "_ChangeBkCol")
GUICtrlCreateButton("Standard", 110, 20, 70, 20)
GUICtrlSetOnEvent(-1, "_ChangeBkCol")

GUICtrlCreateButton("Flat", 20, 70, 70, 20, $BS_FLAT)
GUICtrlSetOnEvent(-1, "_MakeDefBkCol")
GUICtrlCreateButton("Standard", 110, 70, 70, 20)
GUICtrlSetOnEvent(-1, "_MakeDefBkCol")

GUISetState()

While 1
	Sleep(100000)
WEnd

Func _ChangeBkCol()
	GUICtrlSetBkColor(@GUI_CtrlId, 0x00FF00)
EndFunc

Func _MakeDefBkCol()
	GUICtrlSetBkColor(@GUI_CtrlId, Default)
EndFunc

Func _Exit()
	Exit
EndFunc

Attachments (0)

Change History (4)

comment:1 Changed 15 years ago by Valik

  • Description modified (diff)
  • Resolution set to No Bug
  • Status changed from new to closed

No color means invisible. So with that little obvious nugget of information in mind, think about what you are trying to do and then try thinking about a rather obvious solution.

comment:2 Changed 15 years ago by funkey

It's not possible to change the color of a flat button without making it a standard-button. I don't know why this is no bug!?

comment:3 Changed 15 years ago by Valik

Lack of detail is never a good thing. You didn't mention you were using the Classic theme and that's a super important detail because BS_FLAT doesn't really change the buttons appearance if the button is themed.

Anyway, this is either "no bug" or "won't fix". To draw themed or styled buttons with color is a lot of code (to do it right, anyway). You'll have to figure out how to use an owner-drawn button to do it yourself.

comment:4 Changed 15 years ago by funkey

thx for information!
I will make an (128) owner-drawn flat button(s). ;)

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.