Search code examples
axaptamicrosoft-dynamicsdynamics-ax-2009

Button text on multiple lines AX2009


Is it possible to make the text for a button span two lines instead of just one on a form?

I have already tried inserting a line break (\n) in the text for a button, but that did not work, also when done from the code.

This is in AX2009


Solution

  • It seems this is only something you can accomplish via X++ modification of the button properties:

    button1.text("line 1\nline 2");
    

    Will make the text on the button appear

    line 1
    line 2
    

    However, in my testing I was not able to get the text to align vertically within the control (the bottom edge of the second line was cut off if the height was less than 50). I believe the only way around this would be to change the top margin of the button, but I can't find any property on the button to control this.