Color and controls?

abartonicekabartonicek Member Posts: 162
edited 2005-11-22 in Navision Attain
I know that UPDATEFORECOLOR can be called only from OnFormat trigger so my question is:

Is there any way to (dynamically) change button or label font color?
Better to be critical then self-critical :)

Comments

  • krikikriki Member, Moderator Posts: 9,112
    I checked it out, but I don't find anything that allows to do it. So I am afraid it is not possible.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    You can take a textbox and set the borderproperty to false, then update the color.

    You can put the labeltext in the sourceexpression.

    You can also add leadersdots to a textbox.

    It's a workaround :?
  • abartonicekabartonicek Member Posts: 162
    That works for!
    OK, we have workaround for Label.

    Any idea for Button, Menu button or Menu button menu items?
    Better to be critical then self-critical :)
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    How many colors do you want? :?

    If you want e.g. to flip red/green you can make 2 buttons visible/invisible :oops:

    Otherwise I cannot think of anything. :(
  • SavatageSavatage Member Posts: 7,142
    If you want e.g. to flip red/green you can make 2 buttons visible/invisible :oops:

    Here's an old doc I'd figure I'd throw in here before I lose it forever on my hard drive. O:)

    Issue

    How can I dynamically control Command and Menu buttons on Navision forms?

    Resolution

    Assign a value to the Name property of a command or menu button then you can dynamically set the Enabled or Visible properties of the control in the trigger code using C/AL commands.

    For example, to disable a menu button that has the value of the Name property set to btnCustomer, you would use the following command:

    CurrForm.btnCustomer.ENABLED(FALSE);

    Unfortunately, there is not a method to dynamically control the individual menu items of a menu button. However, it would be possible to create two different menu buttons with different Name property values. These two button controls could then be stacked on top of each other and trigger code added to the form to make one button visible and one button not visible, based upon the desired criteria.

    For example, to control which menu button is displayed, based on the existence of a customer email address, where the button controls were named btnCustomer1 and btnCustomer2, you would use the following code in the OnAfterGetCurrRecord trigger:

    IF "E-Mail" = '' THEN BEGIN
    CurrForm.btnCustomer1.VISIBLE(TRUE);
    CurrForm.btnCustomer2.VISIBLE(FALSE);
    END ELSE BEGIN
    CurrForm.btnCustomer1.VISIBLE(FALSE);
    CurrForm.btnCustomer2.VISIBLE(TRUE);
    END;
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Yepyep, thats what I meant :wink:

    Thanks Harry :D
  • abartonicekabartonicek Member Posts: 162
    I already done hiding menu button, guess I'll do it again :)

    I hoped there are some more sophisticated method :)
    Better to be critical then self-critical :)
  • jreynoldsjreynolds Member Posts: 175
    You could try something like the comment button on the sales order form. Here the button is transparent and there is a bitmap control behind the button so the button takes on the appearance of the bitmap.
  • abartonicekabartonicek Member Posts: 162
    I can't find it.
    I'm looking at Form 42!
    I have localized version, does this matter?
    Better to be critical then self-critical :)
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    It is the little pencil next to the no. field on virtualy any card form of navision.
  • abartonicekabartonicek Member Posts: 162
    OK, found it!
    Thanks.
    Better to be critical then self-critical :)
  • abartonicekabartonicek Member Posts: 162
    Apparently this method works only with Command Button but NOT with Menu Button ](*,)
    Better to be critical then self-critical :)
Sign In or Register to comment.