var frame,caption: Integer; begin frame := (Width - ClientWidth) div 2; caption := Height - ClientHeight - frame * 2; ShowMessageFmt('边框宽: %d; 标题高: %d', [frame,caption]); {边框宽: 4; 标题高: 26} end;方法二(用 GetSystemMetrics 函数获取):
var frame,caption: Integer; begin frame := GetSystemMetrics(SM_CXFRAME); caption := GetSystemMetrics(SM_CYCAPTION); ShowMessageFmt('边框宽: %d; 标题高: %d', [frame,caption]); {边框宽: 4; 标题高: 26} end;