RobotStudio event

TextAlign on buttons fails with 2 line text

Using ScreenMaker included with RS 5.13.01
Add button to screen with size 80,80
Enter text "Index No Weld"
Set font to TpsFont12b
Set TextAlign to "MiddleCenter"

The problem is that with a button this size, the text wraps to 2 lines.  For some reason the display ignores the text alignment of center and makes it left.  Why does it do this?  Is there a way to center this text?  Is there a way to insert a line feed (LF) or carriage return (CR) in the text?

Comments

  • Hello,
     

    Button Text Alignment does not seem to work very well when the size of the button is small as in your case. The text is wrapped by default in Button control and .NET Compact Framework does not directly support alignment of text in button control.

     

    Possible solutions:

    1. May be you can think of re-phrasing the text.

    2. Increasing the size of the button

    3. Try using TpsLabel instead of Button Control to see if the text alignment meets your requirements. Click event can be defined for TpsLabel and states of the control can be changed as well similar to button control.

     

    Thanks