dynamically change text box background color?

MBCrushMBCrush Member Posts: 6
edited 2005-03-15 in Navision Financials
I am currently running Navision Financials 2.6 .. is there a way to dynamically modify the background color of a text box on forms? :?:

Comments

  • Dean_AxonDean_Axon Member Posts: 193
    On a form you can only change the following with code:
      Indent Selected Editable ForeColour FontBold

    so I guess the answer is no :roll:
    Remember: Keep it simple
  • HalMdyHalMdy Member Posts: 429
    Or you have to play with different Shapes (in different colour) and make them VISIBLE or not depending of your needs ...
  • MBCrushMBCrush Member Posts: 6
    bummer .. would have worked out nice for my new project ..
  • UrmasUrmas Member Posts: 76
    There is nothing impossible in IT world...

    The approach described below works only for card type forms

    Create an edit box
    set a font of this edit box to be WingDings
    Add a block character as sourceexpression ('n')
    Make the character BIG (I used size 300)
    Disable borders, focusing

    Create another edit box on top of first and assign field/variable as you usually do
    Set the BackTransparent property to TRUE

    Now- if you change (dynamically) the foreground color ofthe first edit the user will see the background of the second edit changing...
  • DenSterDenSter Member Posts: 8,304
    You could also create a bunch of textboxes in various colors with the same source expression, put them all in the same xpos and ypos and only show the one (using the VISIBLE property in your C/AL code) with the right color. This would work with both card type and list type forms, only with list type forms, the user can make all of them visible.
  • MBCrushMBCrush Member Posts: 6
    great tip, thank you .. unfortunately, though, my particular need is to be able to dynamically change the background of a particular field on a particular row of a list subform (ie - set the background on the "Sales Line".Description of the Sales Order subform to a different color (light grey) to denote a particular situation .. changing the font works, but changing the background gives a much better feel to my users .. hmmm, I wonder if I can implement a variation of your tip to accommodate my need .. time to experment again!
  • UrmasUrmas Member Posts: 76
    edited 2005-03-15
    Naturally, there is always a possibility to design your own font - what would be displayed in reverse, so that the foreground change will actually change the background. ;-)
    Maybe there is something like this on the net...
  • UrmasUrmas Member Posts: 76
    One more idea

    If you need to alternate between 2 colors you can use the UPDATESELECTED function in OnFormat trigger.
    I am using it in synchronized windows to show the position of the cursor in slave window. It can be quite tricky, but still can be managed.
Sign In or Register to comment.