General Help regarding HMG, Compilation, Linking, Samples
Moderator: Rathinagiri
serge_girard
Posts: 3309 Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB 2 DBF
Location: Belgium
Contact:
Post
by serge_girard » Sat Jun 13, 2020 11:03 am
Hello,
I want to change backcolor (or fontcolor) in RED when some value is wrong in a READONLY field and I use this code:
Code: Select all
@ 10,10 TEXTBOX T_1 Of Form_1 ;
WIDTH 50 ;
VALUE 'something' ;
MAXLENGTH 40 ;
TOOLTIP 'something' ;
FONT 'Arial' SIZE 10 ;
BACKCOLOR WHITE ;
FONTCOLOR BLUE BOLD ;
READONLY
Form_1.T_1.DisabledBackColor := RED
Form_1.T_1.DisabledFontColor := RED
SetProperty ( 'Form_1' , 'T_1', 'DisabledBackColor', RED)
SetProperty ( 'Form_1' , 'T_1', 'DisabledFontColor', RED)
But both methods seem to do nothing. Anybody knows why this isn't working?
Serge
There's nothing you can do that can't be done...
andyglezl
Posts: 1461 Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:
Post
by andyglezl » Sat Jun 13, 2020 1:25 pm
Hola Serge
Creo que eso me paso a mi y lo solucione de esta forma.
*---------------------------------------------------------------------
Hi Serge
I think that happened to me and I solved it this way.
Code: Select all
@ 035,220 EDITBOX EB_1 WIDTH 790 HEIGHT 630 VALUE "" FONT "Arial" SIZE 10 FONTCOLOR BLACK BACKCOLOR { 227, 239, 255 } ;
NOHSCROLL MAXLENGTH 60000 DISABLEDFONTCOLOR BLACK DISABLEDBACKCOLOR { 227, 239, 255 }
w_test.EB_1.ReadOnly := .F.
.............
IF something
w_test.EB_1.ReadOnly := .F.
ELSE
w_test.EB_1.ReadOnly := .T.
ENDIF
Andrés González López
Desde Guadalajara, Jalisco. México.
serge_girard
Posts: 3309 Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB 2 DBF
Location: Belgium
Contact:
Post
by serge_girard » Sat Jun 13, 2020 3:30 pm
Thanks Andres, I will try!
Serge
There's nothing you can do that can't be done...
jozef
Posts: 23 Joined: Sat Apr 02, 2016 4:53 pm
DBs Used: DBF
Location: Bratislava, Slovak Republic
Post
by jozef » Sun Jun 14, 2020 5:11 pm
serge_girard wrote: ↑ Sat Jun 13, 2020 11:03 am
Hello,
I want to change backcolor (or fontcolor) in RED when some value is wrong in a READONLY field and I use this code:
Code: Select all
@ 10,10 TEXTBOX T_1 Of Form_1 ;
WIDTH 50 ;
VALUE 'something' ;
MAXLENGTH 40 ;
TOOLTIP 'something' ;
FONT 'Arial' SIZE 10 ;
BACKCOLOR WHITE ;
FONTCOLOR BLUE BOLD ;
READONLY
Form_1.T_1.DisabledBackColor := RED
Form_1.T_1.DisabledFontColor := RED
SetProperty ( 'Form_1' , 'T_1', 'DisabledBackColor', RED)
SetProperty ( 'Form_1' , 'T_1', 'DisabledFontColor', RED)
But both methods seem to do nothing. Anybody knows why this isn't working?
Serge
Hi Serge,
I have the same problem. And I found this
http://www.hmgforum.com/viewtopic.php?f ... ive#p49712
Jozef
serge_girard
Posts: 3309 Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB 2 DBF
Location: Belgium
Contact:
Post
by serge_girard » Mon Jun 15, 2020 7:01 am
Thanks Jozef, I change my TEXTBOX to ENABLED!
Serge
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
Post
by franco » Mon Jun 15, 2020 4:58 pm
Hi Serge, I do this a different way.
If you enable the textbox the data can be changed.
What I do is change the fontcolor of the label of the textbox if something .
Code: Select all
Win.Label.FontColor := BLACK
If win.textbox.value = "No"
win.Label.fontcolor := RED
endif
Do not know if this is similar.
Franco
Last edited by
franco on Mon Jun 15, 2020 6:23 pm, edited 1 time in total.
All The Best,
Franco
Canada
mol
Posts: 3774 Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:
Post
by mol » Mon Jun 15, 2020 6:05 pm
Textbox can be enabled, but readonly. Then it should work.
When you don't need interaction with user, you can use label with clientedge. Such a label looks like textbox
jorge_riv
Posts: 86 Joined: Thu Nov 22, 2018 2:20 pm
DBs Used: DBF, MySQL,SQL SERVER, Oracle.
Post
by jorge_riv » Mon Jun 15, 2020 8:09 pm
Prueba esto:
@ 10,10 TEXTBOX T_1 Of Form_1 ;
WIDTH 50 ;
VALUE 'something' ;
MAXLENGTH 40 ;
TOOLTIP 'something' ;
FONT 'Arial' SIZE 10 ;
BACKCOLOR WHITE ;
FONTCOLOR BLUE BOLD ;
READONLY
...
...
Form_1.T_1.FontColor := IF( lROnly, BLACK , RED } )
Form_1.T_1.BackColor := IF( lROnly, YELLOW, BLUE )
serge_girard
Posts: 3309 Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB 2 DBF
Location: Belgium
Contact:
Post
by serge_girard » Mon Jun 15, 2020 8:39 pm
Thanks all for helping!
Serge
There's nothing you can do that can't be done...