It is not clear what you are trying to do. x and y are positional elements, width and height are size elements. If you position the shortcut, you should probably use top, left, right and bottom , rather than x and y , if you want it to be the size as the size of the parent control.
If you want the label to be centered, you can use horizontalCenter and verticalCenter .
If you place it inside a layout control, such as panel or canvas , you can just set its left and right to 0 and have the size of the canvas.
If your shortcut is always located elsewhere depending on size, you can override updateDisplayList to set the position. This applies to whether you put it in the layout control or not.
Simon
source share