16,748
社区成员
发帖
与我相关
我的任务
分享
var
Dc: HDC;
R: TRect;
begin
Dc := GetWindowDC(Handle);
R := Rect(2, 2, Width - 4, Height - ClientHeight);
SetBkMode(Dc, TRANSPARENT);
SetTextColor(Dc, clWhite);
Windows.DrawText(Dc, PChar('dd'), -1, R, DT_VCENTER or DT_EDITCONTROL or DT_WORDBREAK);
end;
窗体创建时加上
//右对齐
SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_RIGHT);