How can we change the color of a text item on a button ?
I have a calendar and I want some days ( no appointments ) in grey, while days with activity I want shown in blue. Finally, the current day needs to stand out in red.
The buttons are stored in a two dimensional array.
The problem is that I'm having difficulty changing the text color on the button.
Must be old age ....
Tim
Text color on button
Text color on button
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Text color on button
You can't change the colors of a TButton (standard Windows pushbuttons). Try using a TBtnBmp instead (or maybe a TButtonBmp but I'm not sure).TimStone wrote:How can we change the color of a text item on a button ?
EMG
Button
OK ... so I'm not losing my mind. Thanks ...
Tim
Tim
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Tim,
TSButton has a setColor() method, but I have never tried it.
TSButton is included in TSBrowse, and you can get a copy on my website on this page:
http://ourworld.compuserve.com/homepage ... rogram.htm
James
TSButton has a setColor() method, but I have never tried it.
TSButton is included in TSBrowse, and you can get a copy on my website on this page:
http://ourworld.compuserve.com/homepage ... rogram.htm
James
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
Tsbutton works OK with Setcolor, i use it in my appJames Bott wrote:Tim,
TSButton has a setColor() method, but I have never tried it.
TSButton is included in TSBrowse, and you can get a copy on my website on this page:
http://ourworld.compuserve.com/homepage ... rogram.htm
James
here is a working sample
REDEFINE SBUTTON FILE DIRAPPLI() + "BMP\AIDE.BMP" ID 301 of Odlg ;
TOOLTIP "Aide" ;
COLORS CLR_WHITE, ;
{|oB| If( oB:lMouseOver, {CLR_WHITE,CLR_BLUE }, ;
{CLR_BLUE,CLR_WHITE} ) } ;
ROUNDRECT TEXT POSITION ON_RIGHT CANCEL ;
ACTION DETHELP("CAISSPAR")
Tim, if you need the xbp file to build the tsbutton library, let me know
Richard
Buttons
I was able to use BTNBMP to do what I want, and I changed the background to a bitmap.
Tim
Tim
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Buttons
You can even use SetColor() method without using a bitmap:
EMG
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, oBtn
LOCAL cVar := SPACE( 20 )
DEFINE DIALOG oDlg
@ 1, 1 GET cVar;
VALID !EMPTY( cVar )
@ 30, 10 BTNBMP oBtn PROMPT "Close";
ACTION oDlg:End()
oBtn:SetColor( CLR_RED, CLR_YELLOW )
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL