button backcolor

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

button backcolor

Post by franco »

I am trying to set the backcolor of a button.
Is this possible. I can do it with a label but setting the text of a label is harder.

Code: Select all

Define Button button_1
Row 60
Col 135
Caption 'Hello'
BackColor {72,255,72}
End Button
Thanks in advance
All The Best,
Franco
Canada
User avatar
serge_girard
Posts: 3309
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: button backcolor

Post by serge_girard »

Franco,

According to the DOCS there is no backcolor for buttons...
There's nothing you can do that can't be done...
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: button backcolor

Post by franco »

Thanks Serge,
I am changing all my buttons to labels. It seems to work and gives my screens a brighter and more modern look.

Code: Select all

Define Label button_1             //change
Row 60
Col 135
Value 'Hello'                           //change
BackColor {72,255,72}
End Label                               //change
This way references stay same as names are still button
All The Best,
Franco
Canada
User avatar
serge_girard
Posts: 3309
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: button backcolor

Post by serge_girard »

I did the same!
There's nothing you can do that can't be done...
User avatar
jorge_riv
Posts: 86
Joined: Thu Nov 22, 2018 2:20 pm
DBs Used: DBF, MySQL,SQL SERVER, Oracle.

Re: button backcolor

Post by jorge_riv »

@ 10,Y BUTTONEX Bt_Exit WIDTH 139 HEIGHT 30 CAPTION "Exit" ;
ICON cImg FONTCOLOR BLACK SIZE 18 BOLD FLAT NOXPSTYLE ;
HANDCURSOR NOTABSTOP BACKCOLOR {{0.5,CLR_BLANCO, ;
CLR_NEGRO},{0.5,CLR_NEGRO,CLR_BLANCO}} GRADIENTFILL ;
{{0.5,CLR_ROJO,CLR_BLANCO},{0.5,CLR_BLANCO,CLR_ROJO}} ;
ON MOUSEHOVER ( This.Backcolor:=BLACK, ;
This.Fontcolor := WHITE,This.Icon := cIco, ;
This.ImageWidth := 45,This.ImageHeight := 45 ) ;
ON MOUSELEAVE ( This.Backcolor:=RED, ;
This.Fontcolor := BLACK,This.Icon := cImg, ;
This.ImageWidth := 45,This.ImageHeight := 45 ) ;
ACTION (IF(Salida_Color(),ThisWindow.Release, ;
This.Setfocus))
c_aTip := InitToolTipEx( This.Bt_Exit.Handle,," ",'Salida', 2,;
hb_bitOr(TTS_BALLOON,TTS_NOFADE),TTF_SUBCLASS)

PD: el bottom esta programado en: Harbour MiniGUI Extended Edition 24.06 (Standard)
User avatar
mol
Posts: 3774
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: button backcolor

Post by mol »

Labels work very fine, tou can use hover effect, you can also set alignment. i use them in a few of my applications. You can also set tabstop
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: button backcolor

Post by franco »

Thanks Jorge,
This works good in minigui.
Is there a way to add minigui to hmg, I can not get it to work in hmg.
Like

#include <hmg.ch>
#include <minigui.ch>
DEFINE BUTTONEX BUTTON_1
BACKCOLOR{168,0,0}
END BUTTONEX
All The Best,
Franco
Canada
User avatar
mol
Posts: 3774
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: button backcolor

Post by mol »

I don't think it's possible to add buttoex to hmg in simple way
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: button backcolor

Post by franco »

The label colors look so blaw, is there a way to living them up. Like dark edges and lighter in the middle.
All The Best,
Franco
Canada
User avatar
serge_girard
Posts: 3309
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: button backcolor

Post by serge_girard »

Perhaps you can use a picture or some image?
There's nothing you can do that can't be done...
Post Reply