隨筆 - 6  文章 - 129  trackbacks - 0
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(14)

          隨筆檔案(6)

          文章分類(lèi)(467)

          文章檔案(423)

          相冊(cè)

          收藏夾(18)

          JAVA

          搜索

          •  

          積分與排名

          • 積分 - 827168
          • 排名 - 49

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          delphi
          Delphi遍歷文件夾及子文件夾      摘要: 字符截取函數(shù)LeftStr, MidStr, RightStr
          這幾個(gè)函數(shù)都包含在StrUtils中,所以需要uses StrUtils;
          假設(shè)字符串是 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 閱讀(3556) | 評(píng)論 (0)  編輯
          為T(mén)ListBox組件添加水平滾動(dòng)條      摘要: Delphi的TListBox組件會(huì)自動(dòng)添加一個(gè)垂直滾動(dòng)條,即當(dāng)列表框的高度容納不下所有的列表?xiàng)l目時(shí),垂直滾動(dòng)條就自動(dòng)顯示。但是,當(dāng)條目的寬度大于列表框的寬度時(shí),水平滾動(dòng)條不會(huì)自動(dòng)顯示。當(dāng)然, 可以在列表框中加如水平滾動(dòng)條,方法是在窗體的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 閱讀(385) | 評(píng)論 (0)  編輯
          Delphi中Format與FormatDateTime函數(shù)詳解      摘要: 總結(jié)一下Format的用法:

          Format('x=%d',[12]);//'x=12'//最普通
          Format('x=%3d',[12]);//'x=12'//指定寬度
          Format('x=%f',[12.0]);//'x=12.00'//浮點(diǎn)數(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'//動(dòng)態(tài)配置
          Format('x=%.5d',[12]);//'x=00012'//前面補(bǔ)充0
          Format('x=%.5x',[12]);//'x=0000C'//十六進(jìn)制
          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 閱讀(29900) | 評(píng)論 (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;

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

          第二步:打開(kāi)dacvcl70.dpk,然后編譯

          第三步:打開(kāi)dcldac70.dpk,然后編譯

          第四步:打開(kāi)odac70.dpk,然后編譯
            閱讀全文
          posted @ 2010-05-06 20:10 Ke 閱讀(1835) | 評(píng)論 (0)  編輯
          Delphi 日誌記錄相關(guān)      摘要: //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 閱讀(542) | 評(píng)論 (0)  編輯
          Delphi 常用函數(shù)整理      摘要: Delphi提供的字符串函數(shù)里有一個(gè)Pos函數(shù),它的定義是:

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

            它的作用是在字符串S中查找字符串Substr,返回值是Substr在S中第一次出現(xiàn)的位置,如果沒(méi)有找到,返回值為0。  閱讀全文
          posted @ 2010-02-11 13:59 Ke 閱讀(274) | 評(píng)論 (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 閱讀(291) | 評(píng)論 (0)  編輯

          主站蜘蛛池模板: 曲麻莱县| 威信县| 静海县| 德化县| 商南县| 大足县| 视频| 友谊县| 绥阳县| 泸定县| 德令哈市| 定结县| 伊宁县| 云阳县| 黄石市| 辉县市| 瑞金市| 灵石县| 罗江县| 饶河县| 玉屏| 西安市| 新巴尔虎右旗| 东光县| 建始县| 宕昌县| 聊城市| 汉源县| 稷山县| 滨州市| 从化市| 龙陵县| 广灵县| 梨树县| 慈溪市| 公主岭市| 仪征市| 锡林浩特市| 涟水县| 伊金霍洛旗| 靖宇县|