Control Runtime Colors

David_FerreiraDavid_Ferreira Member Posts: 6
edited 2000-11-22 in Navision Financials
Hello, I'm new at this so dont laugh too hard,

I've just created an Indicator control that will display a changing amount during runtime, this works, however I also want to change the color of the Gauge bar during runtime, acoording to the value in the srcexp... I have set a case of ranges which can distinguish which color should be used... but how do you change the color during runtime???

i figure it would be something like:

CURRFORM.<CONTROLNAME>.<Format Forecolor(#####)> does anyone know how to do this?

thanks for our help.

Dave.

Comments

  • John_TegelaarJohn_Tegelaar Member Posts: 159
    Use [CurrForm."Your control".]UPDATEFORECOLOR(RGB color value) for this, which function is callable only in the OnFormat trigger of the control. RGB color values can be found by selecting the desired color from the colorbox in the Toolbar as forecolor of the control, then copy the number to your routine.

    John
  • anolisanolis Member Posts: 16
    Befor you do that, make sure you set the name property of the indicator.
    If you don't, Navision will not recognize the control.
    ..Check this by pressing F5 in your C/Al editor.
    Select CurrForm....Controls.
    You will only find your indicater if you named it yourself.


  • David_FerreiraDavid_Ferreira Member Posts: 6
    Thanks guys, Though I couldnt get it to do what I ultimately wanted to, it doesnt matter anyway it was just something that I was trying to work out on my own leisure.

    Your tips helped though, but the Indicator(gauge control) doesnt have the forecolor property on runtime... so I couldnt change it, unless I changed the color before and just keep it that color.

    either way, thanks for your help guys.
    Much appreciated.
    Dave.
  • John_TegelaarJohn_Tegelaar Member Posts: 159
    A bit tricky, perhaps, but you can get reach a change in color by putting two (or three) Indicator controls on top of each other, each having a different color. As long as the counter is within a certain range, you make one of the indicators visible.

    John
  • Dave_CoxDave_Cox Member Posts: 83
    Could you not use the CurrForm.UPDATE;
    This would re run-the Format property

    If (condition = 100)or(condition = 200)or(condition = 300)Then
    CurrForm.UPDATE;

    Onformat trigger code change the font colour base on the condition.
    MindSource (UK) Limited
    Navision Service Partner

    david@mindsource.co.uk
    info@mindsource.co.uk
Sign In or Register to comment.