konhon

          忘掉過去,展望未來。找回自我,超越自我。
          逃避不一定躲的過, 面對不一定最難過, 孤單不一定不快樂, 得到不一定能長久, 失去不一定不再擁有, 可能因為某個理由而傷心難過, 但我卻能找個理由讓自己快樂.

          Google

          BlogJava 首頁 新隨筆 聯系 聚合 管理
            203 Posts :: 0 Stories :: 61 Comments :: 0 Trackbacks
          procedure TForm1.ADODataSet1MaterielNameGetText(Sender: TField;
            var Text: string; DisplayText: Boolean);
          var
            lSingleWidth: integer;
            lDBGridWidth: integer;
          begin
            lSingleWidth := DBGrid1.Canvas.TextWidth('壹');
            lDBGridWidth := DBGrid1.Columns[1].Width;
            if DBGrid1.Canvas.TextWidth(Sender.AsString) <= lDBGridWidth then
              Text := Sender.AsString
            else if DBGrid1.Canvas.TextWidth(Sender.AsString) > lDBGridWidth then
            begin
              lSingleWidth := lDBGridWidth div lSingleWidth - 1;
              if lSingleWidth mod 2 = 1 then
                lSingleWidth := lSingleWidth + 1;
              Text := Copy(Sender.AsString, 1, lSingleWidth) + '...';
            end
          end;
          posted on 2005-08-25 06:57 konhon 優華 閱讀(406) 評論(0)  編輯  收藏 所屬分類: Delphi
          主站蜘蛛池模板: 大名县| 兰考县| 郸城县| 台南县| 江安县| 嘉义县| 武汉市| 东乡族自治县| 商丘市| 桂林市| 咸宁市| 和硕县| 扶风县| 广河县| 安泽县| 青冈县| 收藏| 鹤庆县| 金堂县| 宁化县| 大同市| 工布江达县| 大邑县| 聊城市| 前郭尔| 鱼台县| 通河县| 班戈县| 克山县| 榕江县| 额济纳旗| 六枝特区| 垣曲县| 通山县| 东莞市| 昌宁县| 咸阳市| 开远市| 西吉县| 西畴县| 洪雅县|