隨筆 - 6  文章 - 129  trackbacks - 0
          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(14)

          隨筆檔案(6)

          文章分類(467)

          文章檔案(423)

          相冊

          收藏夾(18)

          JAVA

          搜索

          •  

          積分與排名

          • 積分 - 828897
          • 排名 - 49

          最新評論

          閱讀排行榜

          評論排行榜

          delphi
          Delphi遍歷文件夾及子文件夾      摘要: 字符截取函數(shù)LeftStr, MidStr, RightStr
          這幾個函數(shù)都包含在StrUtils中,所以需要uses StrUtils;
          假設字符串是 Dstr := ’Delphi is the BEST’, 那么
          LeftStr(Dstr, 5) := ’Delph’
          MidStr(Dstr, 6, 7) := ’i is th’
          RightStr(Dstr, 6) := ’e BEST’

          ~~~~~~~~~~~~~~~~~~~~~~~~~
          function RightStr
          (Const Str: String; Size: Word): String;
          begin
          if Size > Length(Str) then Size := Length(Str) ;
          RightStr := Copy(Str, Length(Str)-Size+1, Size)
          end;
          function MidStr
          (Const Str: String  閱讀全文
          posted @ 2010-05-19 11:48 Ke 閱讀(3561) | 評論 (0)  編輯
          為TListBox組件添加水平滾動條      摘要: Delphi的TListBox組件會自動添加一個垂直滾動條,即當列表框的高度容納不下所有的列表條目時,垂直滾動條就自動顯示。但是,當條目的寬度大于列表框的寬度時,水平滾動條不會自動顯示。當然, 可以在列表框中加如水平滾動條,方法是在窗體的OnCreate事件處理程序中加入如下代碼:

          procedure TForm1.FormCreate(Sender: TObject);

          var

          i, MaxWidth: integer;

          begin

          MaxWidth := 0;

          for i := 0 to ListBox1.Items.Count - 1 do

          if MaxWidth < ListBox1.Canvas.TextWidth(ListBox1.Items.Strings[i]) then

          MaxWidth := ListBox1.Canvas.TextWidth(ListBox1.Items.Strings[i]);   閱讀全文
          posted @ 2010-05-19 11:45 Ke 閱讀(392) | 評論 (0)  編輯
          Delphi中Format與FormatDateTime函數(shù)詳解      摘要: 總結一下Format的用法:

          Format('x=%d',[12]);//'x=12'//最普通
          Format('x=%3d',[12]);//'x=12'//指定寬度
          Format('x=%f',[12.0]);//'x=12.00'//浮點數(shù)
          Format('x=%.3f',[12.0]);//'x=12.000'//指定小數(shù)
          Format('x=%8.2f'[12.0])//'x=12.00';
          Format('x=%.*f',[5,12.0]);//'x=12.00000'//動態(tài)配置
          Format('x=%.5d',[12]);//'x=00012'//前面補充0
          Format('x=%.5x',[12]);//'x=0000C'//十六進制
          Format('x=%1:d%0:d',[12,13]);//'x=1312'//使用索引
          Format('x=%p',[nil]);//'x=00000000'//指針
          Format('x=%1.1e',[12.0]);//'x=1.2E  閱讀全文
          posted @ 2010-05-19 10:08 Ke 閱讀(29901) | 評論 (0)  編輯
          Delphi+Codesoft 7.0      摘要: // 變量賦值
          if chkParam.Checked then
          begin
          BarDoc.Variables.Item('var1').Value:= edtPN.Text;
          BarDoc.Variables.Item('var2').Value:= edtPartName.Text;
          BarDoc.Variables.Item('var3').Value:= edtDesc.Text;
          end;

          // 打印標簽
          Bardoc.Printlabel(seqty.Value);
          // Feed
          BarDoc.FormFeed;
          // 關閉
          Bardoc.Close;
          BarApp.Quit;  閱讀全文
          posted @ 2010-05-14 08:12 Ke 閱讀(1319) | 評論 (0)  編輯
          ODAC的安裝和使用(odac570src_0.28)      摘要: 第一步:在odac570src_0.28\Source\Delphi7打開dac70.dpk,然后編譯

          第二步:打開dacvcl70.dpk,然后編譯

          第三步:打開dcldac70.dpk,然后編譯

          第四步:打開odac70.dpk,然后編譯
            閱讀全文
          posted @ 2010-05-06 20:10 Ke 閱讀(1839) | 評論 (0)  編輯
          Delphi 日誌記錄相關      摘要: //sDir:=ExtractFilePath(Application.ExeName)+'\';
          ForceDirectories(sDir + 'TESTLOG');
          sBackupFile := sDir + 'TESTLOG\'+FormatDateTime('YYYYMMDDHH',now())+'.log';
          AssignFile(vFile, sBackupFile);
          if FileExists(sBackupFile) then
          Append(vFile)
          else
          Rewrite(vFile);  閱讀全文
          posted @ 2010-02-19 14:50 Ke 閱讀(546) | 評論 (0)  編輯
          Delphi 常用函數(shù)整理      摘要: Delphi提供的字符串函數(shù)里有一個Pos函數(shù),它的定義是:

          function Pos(Substr: string; S: string): Integer;

            它的作用是在字符串S中查找字符串Substr,返回值是Substr在S中第一次出現(xiàn)的位置,如果沒有找到,返回值為0。  閱讀全文
          posted @ 2010-02-11 13:59 Ke 閱讀(277) | 評論 (0)  編輯
          AssignFile Procedure Assigns a file handle to a binary or text file      摘要: AssignFile
          Procedure Assigns a file handle to a binary or text file  閱讀全文
          posted @ 2010-02-09 15:42 Ke 閱讀(294) | 評論 (0)  編輯
          Delphi快捷鍵
          posted @ 2010-02-09 08:52 Ke 閱讀(390) | 評論 (0)  編輯

          主站蜘蛛池模板: 商丘市| 宁海县| 易门县| 刚察县| 阳谷县| 十堰市| 和硕县| 德兴市| 喜德县| 安多县| 霍州市| 江安县| 红桥区| 巍山| 浮梁县| 绵阳市| 岳阳县| 白水县| 南乐县| 郑州市| 静乐县| 鄯善县| 沾益县| 招远市| 墨江| 仪陇县| 四平市| 会同县| 二连浩特市| 浦东新区| 两当县| 通辽市| 威海市| 北碚区| 山阳县| 富蕴县| 原平市| 体育| 汽车| 方山县| 苏尼特左旗|