0

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

user3660338
  • 296
  • 5
  • 23

1 Answers1

1

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.

kingofzeal
  • 1,359
  • 3
  • 12
  • 24
  • I have tried this already, but it did not work. I tried again now and it did not work. Where are you running this when you open the form? – user3660338 May 23 '14 at 12:56
  • interestingly enough, I'm hopping on the same framework as [your previous question](http://stackoverflow.com/questions/23787228/ax2009-loop-through-all-the-controls-in-the-form-on-init). It seems to only work when applied to the FormBuildButtonControl prior to init. I wasn't even able to replicate the result outside of the loop iteration (also prior to init). – kingofzeal May 23 '14 at 13:33