>>893
int Textlen = Canvas->TextWidth(Caption);
if(Textlen > Width) Width = Textlen;