辰峰微网

DBGridEh1.ColWidthsChanged //双击单列自动适应列宽

1813 阅读
文章摘要
DBGridEh1.ColWidthsChanged//添加如下代码
//双击单列自动适应列宽
    if not Assigned(FilterControlList) then Exit;
    Indent := IndicatorWidth+2;
    for i := 0 to DBGridEh1.Columns.Count-1 do
    begin
      k...
DBGridEh1.ColWidthsChanged//添加如下代码
//双击单列自动适应列宽
    if not Assigned(FilterControlList) then Exit;
    Indent := IndicatorWidth+2;
    for i := 0 to DBGridEh1.Columns.Count-1 do
    begin
      k := FilterControlList.IndexOf(DBGridEh1.Columns.Items[i].FieldName);
      if (k <> -1) then
      begin
        control := (TControl(FilterControlList.Objects[k]));
        control.Left := Indent+1;
        control.Width := DBGridEh1.Columns.Items[i].Width-1;
      end;
      Indent := Indent+DBGridEh1.Columns.Items[i].Width+1;
    end;
分享到:
Jack·高峰
内容作者
人生如逆旅 我亦是行人
手机扫码阅读

微信或手机浏览器扫一扫,随时随地随心阅读与分享

还没有人赞过,来做第一个
🤞 分享

发表评论