int setLabelMargin(string s, double left = 3., double top = 3., double right = 3., double bottom = 3.)
{
GraphLayer gl = Project.ActiveLayer();
if( !gl )
return -1;
GraphObject go = gl.GraphObjects(s);
if( !go )
return -2;
Tree t;
t = go.GetFormat(FPB_DIMENSION, FOB_ALL, TRUE, TRUE);
t.Root.Background.Dimension.Left.dVal = left;
t.Root.Background.Dimension.right.dVal = right;
t.Root.Background.Dimension.top.dVal = top;
t.Root.Background.Dimension.bottom.dVal = bottom;
go.UpdateThemeIDs(t.Root);
go.ApplyFormat(t, TRUE, TRUE);
gl.GetPage().Refresh();
return 0;
}
As for the label you created, goMyText, is named "\"MY_TEXT\"", that is:
int nRet;
nRet = setLabelMargin(""MY_TEXT"", 5.0, 5.0, 5.0, 5.0);
妾+ 午旦 妹罕妾 妾伊 用仇 妾/ 岫ㄞ
妾京用 仍巨 件 侈 件戶' 甘岫平 /欠 白岫妹
併 艮 岫 奈 白 岫
岫