Welcome! Log In Create A New Profile

Advanced

André Labuschagné: WDM22 - Change Color In Looper

Posted by harvey68 
André Labuschagné: WDM22 - Change Color In Looper
September 08, 2018 06:23PM
Autor: André Labuschagné

Link zum Beitrag: [27130.foren.mysnip.de]

Hi All

I am needing to change the colour of a control in a looper based on a
condition. Here is the code I have tried:

TheMax is int = LOOP_MyLooper..Occurrence

FOR Rec = 1 TO TheMax

IF LOOP_MyLooper.ATT_MyStatus..Value = "MyCondition" THEN
LOOP_MyLooper.ATT_MyStatusColor..Color = DarkGreen
END

END

Attribute MyStatus is set to Value
Attribute MyStatusColor is set to Color

Any ideas what I am doing wrong?

Cheers
André
Peter Muckle: WDM22 - Change Color In Looper
September 08, 2018 06:24PM
Autor: Peter Muckle

Link zum Beitrag: [27130.foren.mysnip.de]

Hi,

IF LOOP_MyLooper.ATT_MyStatus..Value = "MyCondition" THEN
LOOP_MyLooper.ATT_MyStatusColor..Color = DarkGreen
END

Should this be

IF LOOP_MyLooper.ATT_MyStatus..Value = "MyCondition" THEN
LOOP_MyLooper.ATT_MyStatusColor..Color = DarkGreen
END
Fabrice Harari: WDM22 - Change Color In Looper
September 08, 2018 06:25PM
Autor: Fabrice Harari

Link zum Beitrag: [27130.foren.mysnip.de]

Hi André,

to complete Peter's message

An attribute is NOT a control where you can use properties.
An attribute is linked to ONE SPECIFIC property of a control.

So you need ot create an attribute linked to the color

Best regards
André Labuschagné: WDM22 - Change Color In Looper
September 08, 2018 06:26PM
Autor: André Labuschagné

Link zum Beitrag: [27130.foren.mysnip.de]

Howdy

Thanks Peter - understood.

Thanks Fabrice - understood - you will notice that I have an attribute
linked to the color property of the control but was addressing it
incorrectly as per Peter's post.

Still learning here - phew - so much to still understand.

Cheers
André
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: