A simple command button should have its label centered inside it, unless you created a text button (found in UIR editor in the 'Toggle button' menu.
As we read in the help for the 'Control attribute' field in SetCtrlAttribute ():
Constant: ATTR_LABEL_TOP
Data Type: int
Description: The vertical offset in pixels of the label relative to the origin of the panel.
The panel origin (0,0) is the upper-left corner of the panel below the title bar and to the right of the panel frame.
Control Types: All except Text Message,
Command Button, Decoration
Values:
VAL_AUTO_CENTER
To center the label in the control, you can use the VAL_AUTO_CENTER constant both for top and left attribute for the control's label.
I attach a simp
le source demo file: use it as the only file for a new project and run it.
Hope this helps
Roberto