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);
©c¡Ï ¤È¥¹ ©f¨u©c ©c¥ì ¥Î¤³ ©c/ ©¦£¯
©c¨Ê¥Î ¤´¥¨ ¥ó ¨× ¥ó¤á' ¥Ì©¦¥ /¤í ¥Õ©¦©f
¨Ö ¦á ©¦£þ ©` ¥Õ ©¦
©¦