找回密码
 立即注册
虾米引擎源代码Delphi3KM2引擎源码20121218CQFIR飞尔引擎20120918源码文字广告位置4
APPLEM2引擎源代码传奇引擎delphi源代码DELPHI视频教程
GSQL_6.5.2.1源代码Delphi即时通讯Delphi源码文字广告位置11
文字广告位置12
文字广告位置13
文字广告位置14
文字广告位置15
文字广告位置16
UC845刺客引擎飞龙3delphi源码文字广告位置18
文字广告位置19
文字广告位置20
文字广告位置21文字广告位置22
文字广告位置23
文字广告位置24
文字广告位置25
文字广告位置26文字广告位置27文字广告位置28
查看: 11|回复: 0

GXX修复网关文字重叠BUG 20260930

[复制链接]

844

主题

42

回帖

5909

积分

管理员

积分
5909

最佳新人活跃会员热心会员推广达人宣传达人突出贡献优秀版主荣誉管理论坛元老

QQ
发表于 昨天 09:34 | 显示全部楼层 |阅读模式
SelGate.png


procedure TFormMain.GridSocketInfoDrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
var
  S: string;
  R: TRect;
begin
  with Sender as TStringGrid do
  begin
    // 背景:选中高亮,否则用网格底色
    if gdSelected in State then
    begin
      Canvas.Brush.Color := clHighlight;
      Canvas.Font.Color  := clHighlightText;
    end
    else
    begin
      Canvas.Brush.Color := Color;
      Canvas.Font.Color  := Font.Color;
    end;
    Canvas.FillRect(Rect);

    S := Cells[ACol, ARow];
    if S <> '' then
    begin
      R := Rect; // 局部副本,避免 DrawText 改写原 Rect 影响别处
      DrawText(Canvas.Handle, PChar(S), Length(S), R,
        DT_CENTER or DT_SINGLELINE or DT_VCENTER or DT_END_ELLIPSIS);
    end;
  end;
end;


LoginGate.png



procedure TFrmMain.GridSocketInfoDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
var
  S: string;
  R: TRect;
begin
with Sender as TStringGrid do
  begin
    // 背景:选中高亮,否则用网格底色
    if gdSelected in State then
    begin
      Canvas.Brush.Color := clHighlight;
      Canvas.Font.Color  := clHighlightText;
    end
    else
    begin
      Canvas.Brush.Color := Color;
      Canvas.Font.Color  := Font.Color;
    end;
    Canvas.FillRect(Rect);

    S := Cells[ACol, ARow];
    if S <> '' then
    begin
      R := Rect; // 局部副本,避免 DrawText 改写原 Rect 影响别处
      DrawText(Canvas.Handle, PChar(S), Length(S), R,
        DT_CENTER or DT_SINGLELINE or DT_VCENTER or DT_END_ELLIPSIS);
    end;
  end;
end;


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|Delphi源代码

GMT+8, 2026-10-21 06:46 , Processed in 0.065905 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表