Can the Caption property for a Menu Button be changed programtically in Navision? For example, “Show Trues” is clicked, and any records that are marked as true are revealed, and the caption on the button changes to “Hide Trues”. Rick at 2400 baud, no one can hear you scream… _________________________________________________ Rick Acton High-Tech Consulting Services 301-662-0732
I don’t believe that you can set the caption property in a trigger. You can, however, set the ShowCaption property to No, and the BackTransparent property to Yes. Then create two label controls containing the two captions you want to display. Put the labels on top of each other and the button on top of the labels. You can then set the Visible property of each label from within a trigger to achieve your desired result.
No, you cannot change these at runtime. But what you could do is have a menu button, create a menu-item in it saying eg. “Show Trues”, and put a source expression in it of type Boolean. In this menu-items “OnPush” trigger code write this code:
MyBool := NOT MyBool;
run the form. After having selected your menu-item the first time, you will see a checkmark to the left of your menu-item. Select it again and checkmark disappears. The checkmark indicates the state of your boolean that you put in the sourceexpression of the menu-item. Hope this works for you, or let me know. Soren Nielsen, moderator Integration/Developer NOLUG
And a comment to Jack’s contribution, we are talking about a menu-button, and not an ordinary button :-). So the trick with multiple labels will not work. Soren Nielsen, moderator Integration/Developer NOLUG