13,825
社区成员
发帖
与我相关
我的任务
分享
int Index = 0, Len = 1;
for (int i = 1; i < Label1->Caption.Length(); i++)
{
if (Label1->Caption.IsLeadByte(i))
{
Index = i;
Len = 2;
break;
}
}
int WordWidth = Label1->Canvas->TextWidth(Label1->Caption.SubString(Index, Len));
int w = (Label1->Width / WordWidth) * WordWidth;
TSize sz = Label1->Canvas->TextExtent(Label1->Caption);
Label1->Height = (sz.cx + w - 1) / w * sz.cy;