How do I change the color of a row

gdkve9gdkve9 Member Posts: 161
Hello everyone,

I am using a touch screen monitor. The form which I am using is a list form. I would like to change the color of the specific record on which user touches.

I have tried the combination of OnFormat() Trigger of the Textbox control and OnAfterGetCurrRec() trigger for working out the same.

But every record of the list gets changed to the specified color.

My mind is stuck ](*,) on searching out a possible way for this.

Advance greetings for everyone who can suggest me how to on this.

Thanks.
Dilip
Falling down is not a defeat..defeat is when you refuse to get up.

Comments

  • vijay_gvijay_g Member Posts: 884
    Put a boolean on onActivate trigger of textbox..
    updatecolor := TRUE;
    
    and write this on onFormat trigger of same..
    IF updatecolor THEN
    CurrForm.Description.UPDATEFORECOLOR(255);
    
  • gdkve9gdkve9 Member Posts: 161
    Dear Vijay,

    Thanks for the reply.

    But OnActive Trigger gets called for every record when form is run and hence again all records are in color=255 (If I am not wrong)
    Dilip
    Falling down is not a defeat..defeat is when you refuse to get up.
  • bbrownbbrown Member Posts: 3,268
    Create a function "SetColor" that returns an integer value of the color you want. Then call the function from UPDATEFORCOLOR. The funciton would typically contain a CASE statement to return various color values based on different criteria.
    CurrForm.Description.UPDATEFORECOLOR(SetColor);
    
    There are no bugs - only undocumented features.
  • gdkve9gdkve9 Member Posts: 161
    Hi BBrown,

    Again this would set all the records with some color. My exact doubt of point is, what is the exact trigger where system fires at the time of touching a specific record.

    For example,

    Step 1: I will run a list form, which would show all the records with
    Back Color = Blue
    Fore Color = White
    Step 2: Now user clicks on particular record and do some action by clicking on the funtions Menu button. So when the user clicks on particular record by touching the screen for doing the action, that record only should change to
    Back Color = Blue
    Fore Color = Red

    Hope I tried to make my scenario a bit detailed.

    Thanks.
    Dilip
    Falling down is not a defeat..defeat is when you refuse to get up.
  • vijay_gvijay_g Member Posts: 884
    gdkve9 wrote:
    But OnActive Trigger gets called for every record when form is run and hence again all records are in color=255 (If I am not wrong)

    No it will exicute when you do focus to that control.
  • bbrownbbrown Member Posts: 3,268
    gdkve9 wrote:
    Hi BBrown,

    Again this would set all the records with some color. My exact doubt of point is, what is the exact trigger where system fires at the time of touching a specific record.

    For example,

    Step 1: I will run a list form, which would show all the records with
    Back Color = Blue
    Fore Color = White
    Step 2: Now user clicks on particular record and do some action by clicking on the funtions Menu button. So when the user clicks on particular record by touching the screen for doing the action, that record only should change to
    Back Color = Blue
    Fore Color = Red

    Hope I tried to make my scenario a bit detailed.

    Thanks.

    Exacty. That is why you use the function to set the color value based on the current record and/or form variables. If you don't want a color change then just exit with ZERO from the function. My common practice is to put this function on the form's main table.
    There are no bugs - only undocumented features.
  • gdkve9gdkve9 Member Posts: 161
    Exactly bbrown.

    Now I could better explain here my problem where I am actually stuck. I am unable to decide when to return color and when (0) in the function since no trigger executes just on a click of the record except OnActivate Trigger.

    But OnActivate trigger also doesnt work since it activates at the Form run which in my case should not happen.

    I am trying it out still, I way found I would mention the same here.

    But would also look for some suggestions which could help me out here.

    Thank u all :)
    Dilip
    Falling down is not a defeat..defeat is when you refuse to get up.
Sign In or Register to comment.