乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      delphi學(xué)習(xí) | 學(xué)步園

       佚名2016 2016-08-04

       1.[Error] DCansactionIformationManagement.pas(171): String literals may have at most 255 elements
      [Fatal Error] DCMain.pas(32): Could not compile used unit 'DCansactionIformationManagement.pas'
      報(bào)錯(cuò):‘不正常定義了參數(shù)。提供了不一致或不完整信息’
      解決方法:語法
      數(shù)據(jù)定義要一致
      2.Edit19.Text:= FieldbyName('SQTcost') 讀取數(shù)據(jù)

        Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
        Dialogs, StdCtrls, Buttons, ComCtrls, TeeProcs, TeEngine, Chart, DbChart,
        ExtCtrls, Series

      3.maskedit1.text:=datetostr(Date()); 獲取當(dāng)前日期
      加一個(gè)timer控件,system里面有,是一塊表的樣子,呵呵。
      雙擊進(jìn)入ontimer事件,然后寫下你的代碼
      Statusbar1.Panels[0].Text:='系統(tǒng)日期:'+datetostr(Now);
      Statusbar1.Panels[1].Text:='系統(tǒng)時(shí)間:'+timetostr(Now);

      OPEN只用來SELECT
      EXECSQL 用所有的
      prepared告訴服務(wù)器準(zhǔn)備要干活了

      有返回一些記錄的用OPEN
      不需要返回記錄的用EXECSQL
      就是說一般用select 要用OPEN
      而像insert .drop等只要用ExecSql

      4.GetCursorValues(tmpX,tmpY);  { <-- get values under mouse cursor }
            Label1.Caption:=GetVertAxis.LabelValue(tmpY)+
                            ' '+
                            GetHorizAxis.LabelValue(tmpX);獲取坐標(biāo)值

      5.滾動(dòng) 代碼  procedure TDemoForm.SpeedButton1Click(Sender: TObject);
      begin
        HorizScroll(10);
      end;

      procedure TDemoForm.SpeedButton4Click(Sender: TObject);
      begin
        HorizScroll(-10);
      end;

      procedure TDemoForm.SpeedButton2Click(Sender: TObject);
      begin
        VertScroll(-10);
      end;

      procedure TDemoForm.SpeedButton3Click(Sender: TObject);
      begin
        VertScroll(10);
      end;

      6.清除系列:if dbchart1.SeriesCount>=0 then
        begin
        for i:=0 to dbchart1.SeriesCount-1 do
          begin
            dbchart1.Series[i].Clear;
          end;
      7.
        table2:=ttable.Create(self);
        table2.DatabaseName:='MS Access Database';
        table2.TableName:='趨勢(shì)分析法';
        series1.DataSource:=table2;
        series1.XLabelsSource:='年份';

        series1.YValues.ValueSource:='預(yù)測(cè)用電量';
        Table2.open;
      end;
      8.

        if radiobutton1.Checked then
          try
          with DataModuleADO.ADOQuery1 do
           begin
            SQL.Clear;
            SQL.Add('insert into 回歸分析法(年份,實(shí)際用電量,年國(guó)內(nèi)生產(chǎn)總值,預(yù)測(cè)用電量,該年人口,誤差,算法,備注)'+
                      ' values (:年份,:實(shí)際用電量,:年國(guó)內(nèi)生產(chǎn)總值,:預(yù)測(cè)用電量,:該年人口,:誤差,:算法,:備注)');
            Parameters.ParamByName('年份').value := ComboBox1.text;
            Parameters.ParamByName('實(shí)際用電量').value := '';
            b:=StrToInt(Parameters.ParamByName('年國(guó)內(nèi)生產(chǎn)總值').value );
            c:=StrToInt(Parameters.ParamByName('該年人口').value );
            Parameters.ParamByName('預(yù)測(cè)用電量').value :=-3.9848*b+0.0727+0.10307*c;
            Parameters.ParamByName('誤差').value := '';
            Parameters.ParamByName('算法').value := '回歸分析法';
            Parameters.ParamByName('備注').value := '';

            ExecSQL;
           end;
          Form22_DCfuheyuce_huiguifenxifa.show(Sender);

          except
          MessageDlg('計(jì)算出錯(cuò)',mtError,[mbok],0);
          end;
      9;
      1.整型
      一個(gè)整型數(shù)據(jù)用來存放整數(shù)。Turbo Pascal支持五種預(yù)定義整型,它們是shortint(短整型)、 integer(整型)、 longint(長(zhǎng)整型)、 byte(字節(jié)型)和 word(字類型),Turbo Pascal分別用相同的名字作為他們的表識(shí)符。每一種類型規(guī)定了相應(yīng)的整數(shù)取值范圍以及所占用的內(nèi)存字節(jié)數(shù)。

      類型數(shù)值范圍占字節(jié)數(shù)格式

      shortint-128..127 1 帶符號(hào)8位

      integer-32768..32767 2 帶符號(hào)16位

      longint-2147483648..2147483647 4 帶符號(hào)32位

      byte0..2551無符號(hào)8位word0..655352 無符號(hào)16位

      說明:integer-32768..32767 2(占字節(jié)數(shù)) 帶符號(hào)16位(格式)

      Turbo Pascal規(guī)定了兩個(gè)預(yù)定義整型常量表識(shí)符maxint和maxlongint,他們各表示確定的常數(shù)值,maxint為32767, maxlongint為2147483647,他們的類型分別是integer 和longint。

      2.實(shí)型
      一個(gè)實(shí)型數(shù)據(jù)用類存放實(shí)數(shù)。Turbo Pascal支持五種預(yù)定義實(shí)型,它們是real(基本實(shí)型)、 single(單精度實(shí)型)、double(雙精度實(shí)型)、extended(擴(kuò)展實(shí)型)、comp(裝配實(shí)型),Turbo Pascal分別用相同的名字作為他們的標(biāo)識(shí)符。每一種類型規(guī)定了相應(yīng)的實(shí)數(shù)取值范圍、所占用的內(nèi)存字節(jié)數(shù)以及它們所能達(dá)到的精度。

      類型數(shù)值范圍占字節(jié)數(shù)有效位數(shù)

      real2.9e-39..1.7e38 6 11..12

      single1.5e-45..3.4e38 4 7..8

      double5.0e-324..1.7e308 8 15..16

      extended3.4e-4951..1.1e4932 10 19..20

      comp-2**63+1..2**63-1 8 19..20

      說明real2.9e-39..1.7e38 6(占字節(jié)數(shù)) 11..12(有效位數(shù))

      Turbo Pascal支持兩種用于執(zhí)行實(shí)型運(yùn)算的代碼生成模式:軟件仿真模式和80x87浮點(diǎn)模式。除了real可以在軟件仿真模式下直接運(yùn)行以外,其他類型必須在80x87浮點(diǎn)模式下運(yùn)行,要在程序頭加編譯指示{$N+,E+}

      3.布爾型
      一個(gè)布爾型數(shù)據(jù)用來存放邏輯值(布爾值)。布爾型的值只有兩個(gè):false和true,并且false的序號(hào)是0,true的序號(hào)是1。false 和true都是預(yù)定義常數(shù)標(biāo)識(shí)符,分別表示邏輯假和邏輯真。boolean是布爾型的類型標(biāo)識(shí)符。

      4.字符型
      字符型用char作為標(biāo)識(shí)符。字符型必須用單引號(hào)括起來,字母作為字符型時(shí),大小寫是不等價(jià)的,并且字符型只允許單引號(hào)中有一個(gè)字符,否則就是字符串。

       

       

      10.整數(shù)到字符串 IntTostr() 字符串=IntTostr(整數(shù))
      字符串到整數(shù) strToInt()
      字符串到小數(shù) StrToFloat()
      小數(shù)到字符串 FloatToStr()  修改庫胡總的數(shù)據(jù)時(shí)候要數(shù)據(jù)類型~~~
      11
          編寫代碼:
           procedure TForm1.Button1Click(Sender: TObject);
            begin
               edit1.Text:=IdIPWatch1.LocalIP;
             end;

        OK!按下F9功能鍵,運(yùn)行程序,點(diǎn)擊button看一下edit1中是不是已經(jīng)顯示了本機(jī)的IP

      地址了?
      12.
           平常使用軟件的時(shí)候,經(jīng)常聽到一些程序居然有背景音樂.呵呵,邊工作學(xué)習(xí),邊聽音樂,真是一大樂趣!

        在delphi編程中如何實(shí)現(xiàn)播放背景音樂呢?我們都知道TMediaPlayer控件可以播放音樂,但我們現(xiàn)在不用它,我們用WINDOWS為我們提供的API函數(shù)來播放音樂,方法如下:

      1 .首先需要在uses部分加入mmsystem.

      2 .為播放按鈕寫代碼:

      MCISendString(OPEN e:/1.MID TYPE SEQUENCER ALIAS NN, , 0, 0);
      MCISendString(PLAY NN FROM 0, , 0, 0);
      MCISendString(CLOSE ANIMATION, , 0, 0);

      3.為停止按鈕寫代碼:

      MCISendString(OPEN e:/1.MID TYPE SEQUENCER ALIAS NN, , 0, 0);
      MCISendString(STOP NN, , 0, 0);
      MCISendString(CLOSE ANIMATION, , 0, 0);

      其中

      NN為自定義名稱標(biāo)志,e:/1.mid為要播放的音樂文件.

      13.
            本文主要講解了如何控制數(shù)據(jù)庫關(guān)鍵字的重復(fù)輸入,這里我們舉一個(gè)簡(jiǎn)單的例子來說明。為了方便我們就使用Delphi自帶的數(shù)據(jù)庫DBDEMOS,它是Paradox型的數(shù)據(jù)庫,其中表employee.db具有關(guān)鍵字EmpNo。

           Table1的DataBaseName是DBDEMOS ,TableName是employee.db,Active設(shè)為True。DataSource1的DataSet是Table1。DBNavigator1和DBGrid1的DataSource是DataSource1。

           下面我們就要寫Table的OnPostError事件:當(dāng)出現(xiàn)重復(fù)的關(guān)鍵字時(shí),首先要提示用戶,然后取消此次操作。這個(gè)事件是在修改或向數(shù)據(jù)庫插入記錄時(shí)產(chǎn)生異常時(shí)才響應(yīng)的。具體代碼如下:

      procedure TForm1.Table1PostError
      (DataSet: TDataSet; E: EDatabaseError;
        var Action: TDataAction);
        begin
          if (E is EDBEngineError) then
      if (E as EDBEngineError).Errors
      [0].Errorcode = eKeyViol then
          begin
            MessageDlg('出現(xiàn)重復(fù)記錄!',
       mtWarning, [mbOK], 0);
            Table1.Cancel;
            Abort;
          end;
      end;

           說明:
           1. 通過EDBEngineError異??梢垣@得描述數(shù)據(jù)庫驅(qū)動(dòng)錯(cuò)誤的詳細(xì)信息。當(dāng)EDBEngineError異常產(chǎn)生時(shí),就會(huì)生成一個(gè)EDBEngineError對(duì)象,這個(gè)EDBEngineError對(duì)象包含有異常的錯(cuò)誤信息,可以用程序進(jìn)行分析,從而決定要完成的操作。

           2. 上面程序的Errorcode是BDE的錯(cuò)誤代碼,是一個(gè)word類型的變量,我們還需要定義它,定義如下

        const
        eKeyViol = 9729;
      14.
        uses   Math;  
         
        Power(X,   Y);

      15.
      如何讓數(shù)據(jù)塊以不同顏色顯示(除了TPieSeries是以不同顏色顯示數(shù)據(jù)塊外,其它的默認(rèn)都是紅色),并動(dòng)態(tài)改變標(biāo)題與頁角及Y坐標(biāo)的標(biāo)題

       

      --------------------------------------------------------------------------------

       

      procedure TForm1.Button5Click(Sender: TObject);
      begin
        Chart1.Series[0].ColorEachPoint:=True; //數(shù)據(jù)塊不同色
        Chart1.LeftAxis.Title.Caption:='產(chǎn)品銷售表';//Y坐標(biāo)標(biāo)題
        Chart1.Title.Text.Clear;
        Chart1.Title.Text.Add('哪個(gè)月份的銷售記錄');//圖表標(biāo)題
        Chart1.Foot.Text.Add('圖表的說明文字'); //頁腳內(nèi)容
      end;

      1,Delphi中提供了大量的決策圖表控件

      Decision->決策,決斷

      Cube->立方

      Chart->圖表

      Series->系列

      TeeChart->T型圖表

      Gallery->圖庫

      Axis->軸線

      Gradient->漸變

      Legend->圖例 傳奇

       

      --------------------------------------------------------------------------------

       

      Delphi7中

      TChart組件---------->Additional

      TDBChart組件----------->Data Controls

      Decision Cube組件組里有一整套

      TVTChart->ActiveX

      ChartFx->ActiveX

      --------------------------------------------------------------------------------

       

      圖表(Chart)組件的屬性絕大多數(shù)一樣,用法也一樣

      1,去掉Chart的3D效果 View3D->False

      2,標(biāo)題文字 Title->Text 有字體屬性

      3,底部文字 Foot->Text 有字體屬性

      4,去掉軸線->AxisVisible->false

      5,BottomAxis   RightAxis LeftAxis TopAxis->上下左右的坐標(biāo)線

      6,Frame->Mode->區(qū)域色與底色的模式

      7,Frame->Style->邊框樣式

      8,Gradient->漸變?cè)O(shè)置

      9,很多屬都可在雙擊Chart進(jìn)行設(shè)置

      10,MaxPointsPerPage->每頁中容納的最大數(shù)據(jù)量->如果為0則表示全部數(shù)據(jù)都裝在一頁中,當(dāng)顯示的數(shù)據(jù)較多時(shí),要設(shè)這個(gè)屬性,只有設(shè)了這個(gè)屬性,才能把數(shù)據(jù)分頁顯示!

      ---------------------------------------------

      設(shè)置這些就可以得到一個(gè)帶漸變的Panel

      ------------------------------------------------------

      如何動(dòng)態(tài)增加一個(gè)圖表?

      --------------------------------------------------------------------------------

       

      注意:TChart, TDBChart只是一個(gè)圖表的容器控件,繼承自Panel,而真正的圖表是一個(gè)不可視的類

      -----------------------------------------------------------------------------------------

      定義條型(反映不同數(shù)據(jù)的變化情況,如,每月,每天銷售的各大類情況,哪類銷售最多,那類銷售最少) 

      var a:TBarSeries;

      定義餅型(主要用于不同數(shù)據(jù)所占的比例,如銷售中,各大類的銷售情況)

      var a:TPieSeries;

      定義折線型(反映同一數(shù)據(jù)的變化,如每天,每月的銷售變化, 這樣可以看出,哪天,哪月的銷售情況最好,最不好)

      var a:TLineSeries

      注意必須引用Series

       

      --------------------------------------------------------------------------------

       

      如何給一個(gè)圖表賦值并顯示在Chart中???

       

      --------------------------------------------------------------------------------

       

      procedure TForm1.Button2Click(Sender: TObject);
      var
        a:TLineSeries;
      begin
        a:=TLineSeries.Create(a);
        Chart1.AddSeries(a);
        a.AddArray([1,3,5,9,4,2])
      end;

       

      --------------------------------------------------------------------------------

       

      如何在已顯示出來的圖表中增加數(shù)據(jù)?

       

      --------------------------------------------------------------------------------

       

      方法1

      procedure TForm1.Button1Click(Sender: TObject);
      begin
         Chart1.Series[0].AddXY(12,20,'新加的',clLime);

      //12->X軸的坐標(biāo)  20->Y軸的坐標(biāo)  Clime是顏色
                                                 
      end;

       

      --------------------------------------------------------------------------------

       

      方法2

      procedure TForm1.Button3Click(Sender: TObject);
      begin
        Chart1.Series[0].Add(14,'打印機(jī)',clTeeColor);
        Chart1.Series[0].Add(18,'主板',clTeeColor);
        Chart1.Series[0].Add(23,'顯示器',clTeeColor);

      end;

       

      --------------------------------------------------------------------------------

       

      如何動(dòng)態(tài)改變圖表背景的漸變

       

      --------------------------------------------------------------------------------

       

      procedure TForm1.Button4Click(Sender: TObject);
      begin
         Chart1.Gradient.Visible:=True;
         Chart1.Gradient.EndColor:=clTeal;
         Chart1.Gradient.StartColor:=clWhite;
      end;

       

      --------------------------------------------------------------------------------

       

      如何讓數(shù)據(jù)塊以不同顏色顯示(除了TPieSeries是以不同顏色顯示數(shù)據(jù)塊外,其它的默認(rèn)都是紅色),并動(dòng)態(tài)改變標(biāo)題與頁角及Y坐標(biāo)的標(biāo)題

       

      --------------------------------------------------------------------------------

       

      procedure TForm1.Button5Click(Sender: TObject);
      begin
        Chart1.Series[0].ColorEachPoint:=True; //數(shù)據(jù)塊不同色
        Chart1.LeftAxis.Title.Caption:='產(chǎn)品銷售表';//Y坐標(biāo)標(biāo)題
        Chart1.Title.Text.Clear;
        Chart1.Title.Text.Add('哪個(gè)月份的銷售記錄');//圖表標(biāo)題
        Chart1.Foot.Text.Add('圖表的說明文字'); //頁腳內(nèi)容
      end;

       

      17;自由改變圖形
        var      
            bar:   TbarSeries;  
            pie:   TpieSeries;  
        begin  
        //柱形圖    
            Title.Text.Clear;  
              Title.Text.Add('表名稱');                          
              bar   :=   TbarSeries.Create(nil);  
              bar.Clear;  
              bar.ParentChart   :=   DBChart1;    
              bar.add(123,'name');  
        //餅圖  
            if   DBchart1.SeriesCount   >   0   then  
                DBchart1.Series[0].Free;//如果表中有圖型將先FREE  
             
              Title.Text.Clear;  
              Title.Text.Add('表名稱');                          
              pie   :=   TbarSeries.Create(nil);  
              pie.Clear;  
              pie.ParentChart   :=   DBChart1;    
              pie.add(123,'name');  
         
         
        end;

      18:
          if DBchart1.SeriesCount>0   then
         DBchart1.Series[0].Free;
        清楚圖表
      19 ;
         窗體的基本方法
      (1)Close方法
           該方法的執(zhí)行將關(guān)閉窗體,其基本語法為:Form1.Close;
      (2)Hide方法
          
      該方法將窗體隱藏起來,其基本語法為:Form1.Hide;
      (3)Release方法
         
       該方法將關(guān)閉窗體并釋放窗體及窗體中組件所占用的內(nèi)存。
      (4)Show方法
         

       該方法將顯示窗體或?qū)⒋绑w置前,使用Show方法可以在窗體不關(guān)閉的情況下切換到調(diào)用它的窗體。值得注意的是:
      在調(diào)用其它窗體時(shí),首先要將被調(diào)用窗體的單元引用到調(diào)用單元中。
      (5)ShowModal方法
           該方法將顯示一個(gè)模式窗體(
      即不能夠切換到其它窗體,如需切換必須關(guān)閉這個(gè)窗體)。
      20,
       7)TabOrder屬性
           TabOrder屬性用來指定按Tab鍵時(shí)獲得焦點(diǎn)的順序。TabOrder屬性的取值類型為Integer,從0開始。
      TabOrder屬性的設(shè)置適用于所有能夠獲得焦點(diǎn)的組件,可以在組件上單擊鼠標(biāo)右鍵,在彈出菜單上選擇“Tab鍵順序…”來設(shè)置Tab鍵順序

      21,Label組件的常用事件:
      (1)OnMouseEnter事件
          
      當(dāng)鼠標(biāo)移動(dòng)到標(biāo)簽上時(shí)觸發(fā)該事件。
      (2)OnMouseLeave事件
         
       當(dāng)鼠標(biāo)離開標(biāo)簽時(shí)觸發(fā)該事件。22
      Active屬性用來說明數(shù)據(jù)庫文件的打開狀態(tài)。應(yīng)用Active屬性來決定及設(shè)定一個(gè)數(shù)據(jù)集組件與

      數(shù)據(jù)庫數(shù)據(jù)之間的關(guān)系。當(dāng)Active屬性值為True時(shí),表明數(shù)據(jù)集是打開的,數(shù)據(jù)集組件可以對(duì)

      數(shù)據(jù)庫進(jìn)行讀寫操作,否則表示數(shù)據(jù)集是關(guān)閉的,數(shù)據(jù)集組件不能從數(shù)據(jù)庫讀取數(shù)據(jù),也不能
      向數(shù)據(jù)庫中寫數(shù)據(jù)。應(yīng)用程序在改變其它影響數(shù)據(jù)庫狀態(tài)或在應(yīng)用程序中顯示數(shù)據(jù)的組件狀態(tài)
      的屬性之前,必須先將Active屬性設(shè)置為False。
      23
       Query1.Fields[0].DisplayLabel:=’第一列’
      使用方法FieldByName按照字段的名字來訪問,如顯示studentinfo表中Name屬性值只需要使
      用代碼Edit1.text:=Table1.FieldByName(‘Name’).AsString;
      24
       try…except…end
      25
        i : integer;
        begin
          for i :=0 to ListView1.Items.Count-1 do
          if ListView1.Items[i].Selected then
             begin
           if ListView1.Items[i].SubItems.Strings[7]='2' then
              begin
              a:=ListView1.Items[i].Caption;
              b:=ListView1.Items[i].SubItems.Strings[0]; //行 列
      26
        DataModule3.adoquery1.close;   
                  DataModule3.adoquery1.SQL.clear;
                  DataModule3.adoquery1.SQL.add ('select  密碼   from  login where 用戶名='''+s+''' ');
                  DataModule3.adoquery1.Open;
                  m:=DataModule3.adoquery1.FieldByName('密碼').Asstring;
                  DataModule3.adoquery2.close;
                  DataModule3.adoquery2.SQL.clear;
                  DataModule3.adoquery2.SQL.add ('select  類別 from  login where 用戶名='''+s+''' ');
                  DataModule3.adoquery2.Open;
                  n:=DataModule3.adoquery2.FieldByName('類別').Asstring;
      27
       const
      TVS_CHECKBOXES = $00000100;

      procedure SetComCtrlStyle(WinCtrl: TWinControl; Value: Integer; UseStyle: Boolean);
      var
      Style: Integer;
      begin
        if WinCtrl.HandleAllocated then
        begin
          Style := GetWindowLong(WinCtrl.Handle, GWL_STYLE);
          if not UseStyle then
          Style := Style and not Value
          else Style := Style or Value;
          SetWindowLong(WinCtrl.Handle, GWL_STYLE, Style);
        end;
      end;

       

      然后 在 OnCreate 調(diào)用:

      SetComCtrlStyle(TreeView1, TVS_CHECKBOXES, True);
       

       

      或者干脆簡(jiǎn)單點(diǎn),一句話完事:

      SetWindowLong(TreeView1.Handle, GWL_STYLE, GetWindowLong(TreeView1.Handle, GWL_STYLE) or $00000100);
       
      28
         for i:=dbChart1.SeriesCount-1 downto 0 do
               begin
               dbChart1.Series[i].Free;
      29
      rocedure TFrmBmGzxmTj.Button1Click(Sender: TObject);
      var
        i:integer;
        xls :OleVariant;
      begin
        if ((DM_GSGL.QryGzxmTj.active=false) or (DM_GSGL.QryGzxmTj.RecordCount=0)) then
        begin
          MessageDlg('沒有數(shù)據(jù),輸出失敗!',mtError, [mbYes],0);
          Exit;
        end;
        xls:=CreateOleObject('Excel.Application');
        xls.WorkBooks.add;
        xls.Visible:=true;
        xls.cells(1,2):='從'+FormatDateTime('yyyymmdd',DtpDate1.Date)+'到'+FormatDateTime('yyyymmdd',DtpDate2.Date);
        xls.cells(2,1):='工號(hào)';
        xls.cells(2,2):='姓名';
        xls.cells(2,3):='人員類別';
        xls.cells(2,4):='總工時(shí)';
        i:=3;
        with DM_GSGL.QryGzxmTj do
        begin
          First;
          while not Eof do
          begin
            xls.cells(i,1):=Fieldbyname('工號(hào)').asstring;
            xls.cells(i,2):=Fieldbyname('姓名').asstring;
            xls.cells(i,3):=Fieldbyname('人員類別').asstring;
            xls.cells(i,4):=Fieldbyname('總工時(shí)').asstring;
            i:=i+1;
            Next;
          end;
        end;
        i:=i+1;
        xls.cells(i,1):='工時(shí)合計(jì)';
        xls.cells(i,4):=label4.Caption;
      end;
      30
       procedure TForm1.Button1Click(Sender: TObject);
      begin
        Chart1.Series[0].AddXY(12,20,'新加的',clLime);

      //12->X軸的坐標(biāo) 20->Y軸的坐標(biāo) Clime是顏色
        
      end;

       

      方法2

      procedure TForm1.Button3Click(Sender: TObject);
      begin
        Chart1.Series[0].Add(14,'打印機(jī)',clTeeColor);
        Chart1.Series[0].Add(18,'主板',clTeeColor);
        Chart1.Series[0].Add(23,'顯示器',clTeeColor);

      end;

       

      如何動(dòng)態(tài)改變圖表背景的漸變

       

      procedure TForm1.Button4Click(Sender: TObject);
      begin
        Chart1.Gradient.Visible:=True;
        Chart1.Gradient.EndColor:=clTeal;
        Chart1.Gradient.StartColor:=clWhite;
      end;

       

      如何讓數(shù)據(jù)塊以不同顏色顯示(除了TPieSeries是以不同顏色顯示數(shù)據(jù)塊外,其它的默認(rèn)都是紅色),并動(dòng)態(tài)改變標(biāo)題與頁角及Y坐標(biāo)的標(biāo)題

       

      procedure TForm1.Button5Click(Sender: TObject);
      begin
        Chart1.Series[0].ColorEachPoint:=True; //數(shù)據(jù)塊不同色
        Chart1.LeftAxis.Title.Caption:='產(chǎn)品銷售表';//Y坐標(biāo)標(biāo)題
        Chart1.Title.Text.Clear;
        Chart1.Title.Text.Add('哪個(gè)月份的銷售記錄');//圖表標(biāo)題
        Chart1.Foot.Text.Add('圖表的說明文字'); //頁腳內(nèi)容
      end;

       

      效果如下:

       

       

       

      數(shù)據(jù)太多了,想翻頁顯示怎么做?

       

      1,設(shè)置Chart->MaxPointsPerPage(每頁的最大數(shù)據(jù)量)->只有設(shè)置了這個(gè)置才可能分頁,如果是0表示,全部數(shù)據(jù)都在一頁上

      2,可以使用點(diǎn)擊左右坐標(biāo)進(jìn)行上下翻頁也可以點(diǎn)擊鼠標(biāo)的左右鍵進(jìn)行翻頁
      -----------------
      procedure TForm1.Chart1ClickBackground(Sender: TCustomChart;
        Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
      begin
        if Button=mbLeft then Chart1.NextPage;
        if Button=mbRight then Chart1.PreviousPage;
      end;

       

      如何標(biāo)顯特殊數(shù)據(jù)(當(dāng)點(diǎn)特殊數(shù)據(jù)時(shí)以不同顏色進(jìn)行顯示)

       

      procedure TForm1.Chart1ClickSeries(Sender: TCustomChart;
        Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton;
        Shift: TShiftState; X, Y: Integer);
      begin
        Series.ValueColor[ValueIndex]:=clRed;
      end;

       

      動(dòng)態(tài)圖表分析技術(shù)

       

      DBChart

      -------------------------------

      動(dòng)態(tài)圖表的連接方式分2種

      ①手工方式連接數(shù)據(jù)庫

      ②運(yùn)用DBChart屬性,在動(dòng)行時(shí)動(dòng)態(tài)連接數(shù)據(jù)庫

      ---------------------------------------

      1,DBChart對(duì)于數(shù)據(jù)是只圖的,所以他連接數(shù)據(jù)庫表,關(guān)不是直接掛連ACCESS組件,而是直接連接DataSet,Table,Query,ClientDataSet這樣的數(shù)據(jù)集組件

      2,首先要設(shè)好數(shù)據(jù)據(jù)組件的連接,再設(shè)置DBChart與數(shù)據(jù)組件連接

      方法如下:

      ①雙擊DBChart->Series->設(shè)置標(biāo)題,X的數(shù)據(jù),Y(Bar)的數(shù)據(jù)

       

      ②,如果是在動(dòng)行時(shí)設(shè)置是設(shè)置是設(shè)置DBChart的如下屬性

      DBChart->DataSet

      DBChart->XLabelSource

      DBChart->XValues

      DBChart->YValues

      ----------------------------

      procedure TForm1.Button3Click(Sender: TObject);
      begin
        DBChart1.Series[0].DataSource:=ADODataSet1;
        DBChart1.Series[0].XLabelsSource:='酒水名稱';
        DBChart1.Series[0].XValues.ValueSource:='單價(jià)';//寫的都是字段名稱
        DBChart1.Series[0].YValues.ValueSource:='單價(jià)';
      end;

      ----------------------------------------

       

      如何讓DBChart自動(dòng)更新數(shù)據(jù)顯示

       

      1,手動(dòng)更新需設(shè)置DBChart->AutoRefresh->Rrue或False

      2,自動(dòng)更新設(shè)置DBChart->RefreshInterval的值,以秒為單位,每隔多少秒更新一次數(shù)據(jù)
      30 listbox的用法
       var
        i:Integer;
      begin
        for i :=0 to ListBox1.Count-1 do
        begin
          if ListBox1.Selected[i] then
          ListBox2.Items.Add(ListBox1.Items.Strings[i]);
        end;
        ListBox1.DeleteSelected;//增加后刪除所選的記錄
      end;
      31
       delphi listbox 添加數(shù)據(jù)
       懸賞分:10 - 解決時(shí)間:2009-2-25 16:23
      怎么把 數(shù)據(jù)庫 當(dāng)中的某一列stu_id數(shù)據(jù)全部添加到listbox當(dāng)中啊
      var s:string;
       close;
       sql.Clear;
       sql.Add('select stu_id  from students');
       s:=fieldbyname('nnbianhao').AsString;
       open;
       first;
       while not EOF  do
       begin
       ListBox1.Items.Add(s);
       next;
       end ;
      32
       Chart.Free;  
       Series.Free;
      33 dbchart的使用
      ADOQuery1.Active:=True;
      DBChart1.Series[0].DataSource:=ADOQuery1;
      DBChart1.Series[0].XLabelSource:='FiledName';
      DBChart1.Series[0].YValues.ValueSource:='FieldName';

      2.切換圖表類型
      tmpChart:=DBChart1.Series[0];
      ChangeSeriesType(tmp,TLineSeries);
      tmpChart.Active:=True;
      tmpChart.RefreshSeries;

      3.設(shè)置分頁
      DBChart1.ScaleLastPage:=true;
      DBChart1.MaxPointsPerPage:=10;

      DBChart1.Page:=1; 代碼實(shí)現(xiàn)
      DBChart1.PreviousPage;
      DBChart1.NextPage;
      DBChart1.Page:=NumPages;

      4.導(dǎo)出圖表
      SaveToBitmapFile(FileName);

      5.打印圖表
      uses TeePrevi;
      ChartPreview(Parent,DBChart1);
      TeePreview(Parent,DBChart1);

      6.數(shù)據(jù)源
      ADODataSet1.CreateDataSet;
      AdoDataSet1.Insert;
      AdoDataSet1.FieldByName('Value').AsFloat:=200000;
      AdoDataSet1.FieldByName('Info').AsString:='05-02';
      AdoDataSet1.Post;  

      33
        ado:
       ADOConnection1.GetTableNames
        for i:= 0 to ADOQuery1.FieldCount-1
             adoQuery1.Fields[i].FullName;
      ....

      bde:
      34
       桂A-撈佬(371775431) 11:27:07
      怎樣在stringgrid中導(dǎo)入Excel
      川A-小鯉魚(252966040) 11:29:09
      用個(gè)讀寫EXCEL的控件
      川A-小鯉魚(252966040) 11:29:27
      讀出EXCEL的CELL值,并加入StringGrid中就行了
      35》
        formatdatetime('aaa',now);//當(dāng)前星期  
        formatdatetime('c',now);//以2003-8-16   23:03:23的形式顯示當(dāng)前日期和時(shí)間  
        formatdatetime('d',now);//顯示當(dāng)前的日期   1被顯示成1  
        formatdatetime('dd',now);//顯示當(dāng)前的日期   1被顯示成01  
        formatdatetime('ddd',now);//顯示當(dāng)前的星期  
        formatdatetime('ddddd',now);//以2003-8-1的形式顯示年月日  
        formatdatetime('dddddd',now);//以2003年8月1日的形式顯示年月日  
        formatdatetime('dddddd   ddd',now);//以‘2003年8月1日   星期五’的形式顯示年月日及星期  
        formatdatetime('e',now);//顯示年的最后一位2003被顯示成3  
        formatdatetime('ee',now);//顯示年的最后二位2003被顯示成03  
        formatdatetime('eee',now);//顯示年2003被顯示成2003  
        formatdatetime('h',now);//顯示小時(shí)1被顯示成1  
        formatdatetime('hh',now);//顯示小時(shí)1被顯示成01  
        formatdatetime('m',now);//顯示月1被顯示成1  
        formatdatetime('mm',now);//顯示月1被顯示成01  
        formatdatetime('mmm',now);//以‘八月’的形式顯示月份  
        formatdatetime('n',now);//顯示當(dāng)前分鐘1被顯示成1  
        formatdatetime('nn',now);//顯示當(dāng)前分鐘1被顯示成01  
        formatdatetime('s',now);//顯示當(dāng)前秒1被顯示成1  
        formatdatetime('ss',now);//顯示當(dāng)前秒1被顯示成01  
        formatdatetime('t',now);//以1:05的形式顯示小時(shí)和分鐘  
        formatdatetime('tt',now);//以1:06:13的形式顯示小時(shí)和分鐘和秒  
        formatdatetime('y',now);////顯示年的最后二位2003被顯示成03  
        formatdatetime('yyy',now);//顯示年2003被顯示成2003  
        formatdatetime('z',now);//顯示當(dāng)前毫秒1被顯示成1  
        formatdatetime('zz',now);//顯示當(dāng)前毫秒1被顯示成01  
        formatdatetime('zzz',now);//顯示當(dāng)前毫秒1被顯示成001

               while not DataModuleADO.ADOQuery1.eof do
          begin
          for i:=0 to DataModuleADO.ADOQuery1.DataSet.Field.Count-1 do
          begin
          a                      Single
          end;

        Next;

        begin
                SetLength(strlist,DBGrid1.DataSource.DataSet.FieldCount-1);
                for   j:=0  to  DBGrid1.DataSource.DataSet.FieldCount-1   do
                strlist[j]:=DBGrid1.DataSource.DataSet.Fields[j].AsString;
               end;

      本實(shí)例要在窗體上直接繪制正弦曲線,為了防止窗口切換的過程中會(huì)輸出不完整的圖形,因此繪制圖形的關(guān)鍵代碼都放在了窗體的OnPaint過程中,代碼如下:
      procedure TForm1.FormPaint(Sender: TObject);
      var
       x: Integer;
       y,a: Double;
      begin
       Canvas.Pen.Width:=3;
       Canvas.MoveTo(0,Trunc(self.ClientHeight/2));
       for x := 0 to self.ClientWidth do
       begin
        a := (x/self.ClientWidth) * 2 * Pi;
        y := Sin(a);
        y := (1-y)*self.ClientHeight/2;
        Canvas.LineTo(Trunc(x), Trunc(y));
       end;
      end;
        程序首先設(shè)置了窗體的Canvas對(duì)象中畫筆的寬度,并且把繪圖的起點(diǎn)移動(dòng)到了窗體中(0,Trunc(self.ClientHeight/2))的位置。然后通過一個(gè)循環(huán)中的a:= (x/self.ClientWidth)*2*Pi語句將一個(gè)正弦周期內(nèi)的角度值轉(zhuǎn)換為弧度值,并且把正弦計(jì)算后的結(jié)果存儲(chǔ)在變量y中。最后,循環(huán)中的Canvas.LineTo(Trunc(x), Trunc(y))語句就會(huì)在窗體上繪制出連續(xù)的正弦曲線。
        程序代碼如下:
      unit Unit1;
      interface
      uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, ExtCtrls, StdCtrls;
      type
       TForm1 = class(TForm)
       procedure FormPaint(Sender: TObject);
       procedure FormResize(Sender: TObject);
       procedure FormCreate(Sender: TObject);
      private
       { Private declarations }
      public
       { Public declarations }
      end;
      var
       Form1: TForm1;
       implementation
       {$R *.dfm}
       procedure TForm1.FormPaint(Sender: TObject);
      var
       x: Integer;
       y,a: Double;
      begin
       Canvas.Pen.Width:=3;
       Canvas.MoveTo(0,Trunc(self.ClientHeight/2));
       for x := 0 to self.ClientWidth do
       begin
        a := (x/self.ClientWidth) * 2 * Pi;
        y := Sin(a);
        y := (1-y)*self.ClientHeight/2;
        Canvas.LineTo(Trunc(x), Trunc(y));
       end;
      end;
      procedure TForm1.FormResize(Sender: TObject);
       begin
        Refresh;
      end;
      procedure TForm1.FormCreate(Sender: TObject);
      begin
       self.DoubleBuffered:=true;
       //防止圖形閃爍
      end;
      end.
        保存文件,然后按F9鍵運(yùn)行程序。在程序運(yùn)行過程中,會(huì)自動(dòng)在窗體上繪制正弦曲線,運(yùn)行結(jié)果如圖1所示。

      圖1 程序運(yùn)行結(jié)果

        通過本程序的學(xué)習(xí),不但可以繪制正弦曲線,也可以繪制余弦曲線、正切曲線等各式各樣的曲線,方便科學(xué)研

       

       

       

      基本安裝1、對(duì)于單個(gè)控件,Componet-->install component..-->PAS或DCU文件-->install;2、對(duì)于帶*.dpk文件的控件包,F(xiàn)ile-->Open(下拉列表框中選*.dpk)-->install即可;3、對(duì)于帶*.bpl文件的控件包,Install Packages-->Add-->bpl文件名即可;4、如果以上Install按鈕為失效的話,試試Compile按鈕;5、是run time lib則在option下的packages下的runtimepackes加之。    如果編譯時(shí)提示文件找不到的話,一般是控件的安裝目錄不在Delphi的Lib目錄中,有兩種方法可以解決:1、反安裝的源文件拷入到Delphi的Lib目錄下;2、或者Tools-->Environment Options中把控件源代碼路徑加入到Delphi的Lib目錄中即可。注意:所安裝的控件是否與你所用的Delphi版本相適應(yīng)。
       控件刪除在Component/Install Packages中刪除。 選Component/configure Palette…有pages和components兩個(gè)區(qū)域雙擊components區(qū)域,選中要?jiǎng)h除得控件,下面有得Delete按鈕但系統(tǒng)提供的控件只能Hide,不能delete。打開控件所在的包文件(*.dpk),從中刪除控件那個(gè)文件,再重新編譯該包即可如果是整個(gè)控件包都要?jiǎng)h除的話,project->Option->Packages,刪掉那個(gè)packages,ok~

       

         ARP -s -d-a
        
         -s——將相應(yīng)的IP地址與物理地址的捆綁。
        
         -d——?jiǎng)h除所給出的IP地址與物理地址的捆綁。
        
         -a——通過查詢Arp協(xié)議表來顯示IP地址和對(duì)應(yīng)物理地址情況。

       

      、怎么樣在delphi中調(diào)動(dòng)其它*.exe文件?
      例如:winexec('d:/鄭洽/Project1.exe',sw_show);

      ==============================================================================

      2、如何讓工程運(yùn)行時(shí)主窗體就是最大化的?
      答:設(shè)置主窗體的WindowsState屬性為wsMaximized就可以了!
      wsNormal 窗體以普通狀態(tài)顯示
      wsMinimized 窗體以最小化狀態(tài)顯示。
      wsMaximized 窗體以最大化狀態(tài)顯示。

      ==============================================================================

      3、我想先->閃現(xiàn)窗體->主窗體->登錄窗體,工程源文件怎么設(shè)置?
      答:
      ⒈開始一個(gè)新工程。給表格起名為MainForm,MainForm的單元起名為Main, 工程文 件起名為Test。
      ⒉在MainForm中插入一個(gè)Button部件,將其Caption屬性設(shè)為“關(guān)閉”,為該部件 的onClick事件創(chuàng)建一個(gè)過程,并在過程的begin和end之間插入Close語句。
      ⒊在應(yīng)用程序添加一個(gè)表格,將這個(gè)表格起名為MoveForm,MoveForm 的單元起名 為Move。
      ⒋為便于演示,在MoveForm中插入一個(gè)Label部件,設(shè)置其Caption 屬性為“歡迎 進(jìn)入本系統(tǒng)”。
      5.下一步修改工程的源代碼。選擇View/Project Source,修改begin和end之間的 語句如下:
      程序清單Test.Dpr
      program Test
      uses
      forms,
      Main in 'MAIN.PAS'{MainForm},
      Move in 'Move.PAS'{MoveForm}

      {$R *.RES}

      begin
      MoveForm:=TMoveForm.Create(Application);{Create創(chuàng)建閃現(xiàn)窗口對(duì)象}
      MoveForm.Show;
      MoveForm.Update;
      Application.CreateForm(TMainForm,MainForm);
      MoveForm.Hide;
      MoveForm.Free;{Free從內(nèi)存中釋放對(duì)象}
      Application.Run;
      end.
        第一條語句創(chuàng)建了對(duì)象,該對(duì)象存在內(nèi)存中,但還不能看見, 為了讓它出現(xiàn)并更 新它的內(nèi)容,調(diào)用對(duì)象的Show和Update成員函數(shù):Show和Update。 當(dāng)閃現(xiàn)窗口使 用完后,用Hide函數(shù)將它隱藏起來,然后用Free函數(shù)釋放它所占據(jù)的內(nèi)存。
      6.如果此刻你編譯和運(yùn)行程序,MoveForm窗口一閃而過, 你可能未來得及看 清。為使MoveForm窗口顯示幾秒種,我們可為MainForm的OnCreate 事件創(chuàng)建一個(gè) 處理程序,延遲MoveForm窗口的顯現(xiàn)時(shí)間。
      program TMainForm.FormCreate(sender:Tobject);
      var
      currentTime:LongInt;
      begin
      currentTime:=GetTickCount div 1000;
      while ((GetTickCount div 1000)<(currentTime+3) do
      {不做任何事);
      end;
      end.
        GetTickCount函數(shù)返回窗口啟動(dòng)后過去的毫秒數(shù),這個(gè)值除以1000 轉(zhuǎn)化為秒數(shù)。 此時(shí)你編譯運(yùn)行程序,就能得到一個(gè)延遲3秒多的閃現(xiàn)窗口。
      為閃現(xiàn)窗口添加上Image部件,再對(duì)字體及窗口進(jìn)行修飾,我們就能為應(yīng)用程 序,創(chuàng)建一個(gè)精美的封面或在程序啟動(dòng)時(shí)顯示重要提示。

      制作登錄窗體一個(gè)很方便的方法就是主窗體作為主窗體,登錄成功Hide掉就行了。
      如果登錄窗體不可以作為主窗體,那么和閃現(xiàn)窗體一樣的方法創(chuàng)建登錄窗體,加在Application.Run;之前,MoveForm.Free;之后,
      用showmodal顯示登錄窗體

      ==============================================================================

      4、button上面的文字怎么樣換行?
      答:
      button控件不行
      bitbtn控件可以。
      bitbtn1.caption:='aaaa'#13'bbbbb'

      ==============================================================================

      5、怎么樣判別焦點(diǎn)是否在某個(gè)控件上?
      答:
      if Tobject.focused then
      //焦點(diǎn)在某某控件上
      else

      ==============================================================================

      6、怎么樣在程序中使一個(gè)節(jié)點(diǎn)的子節(jié)點(diǎn)展開及收閉?
      答:
      treeview1.selected.Expanded; //判斷節(jié)點(diǎn)的子節(jié)點(diǎn)是否展開True展開,否則閉攏
      treeview1.selected.Expand(True);//子節(jié)點(diǎn)展開
      treeview1.selected.collapse(True)://子節(jié)點(diǎn)閉攏

      樹節(jié)點(diǎn)全部展開:
      procedure TForm1.Button1Click(Sender: TObject);
      var node:TTreeNode;
      begin
      if treeview1.Items[0]<>nil then
      begin
      node:=treeview1.Items[0];
      node.Expand(true);
      while node.getNextSibling<>nil do
      begin
      node:=node.getNextSibling;
      node.Expand(true);
      end;
      end;
      end;

      樹節(jié)點(diǎn)全部收縮:
      procedure TForm1.Button2Click(Sender: TObject);
      var node:TTreeNode;
      begin
      if treeview1.Items[0]<>nil then
      begin
      node:=treeview1.Items[0];
      node.Collapse(true);
      while node.getNextSibling<>nil do
      begin
      node:=node.getNextSibling;
      node.Collapse(true);
      end;
      end;
      end;

      ==============================================================================

      7、如何用delphi編程實(shí)現(xiàn)給access數(shù)據(jù)庫加密碼?
      答:1,新建Project。
        2,在FORM中放入ADOConnection控件。
        3,雙擊ADOConnection控件,然后點(diǎn)擊Build...按鈕,在“提供者”頁中選擇“Microsoft Jet 4.0 OLE DB   Provider”,然后點(diǎn)擊“下一步”按鈕,在“連接”頁中選擇要連接的Access數(shù)據(jù)庫的路徑和數(shù)據(jù)庫的文件名,這時(shí)如果點(diǎn)“測(cè)試連接”按鈕時(shí),出現(xiàn)“初始化提供者時(shí)發(fā)生錯(cuò)誤,測(cè)試連接失敗,密碼無效”的錯(cuò)誤提示。
        4,這時(shí)點(diǎn)“所有”頁,然后雙擊“Jet OLEDB:Database Password”,出現(xiàn)對(duì)話框,添入密碼后,選擇“連接”頁中的“測(cè)試連接”按鈕,出現(xiàn)“測(cè)試連接成功”的對(duì)話框。把ADOConnection控件的LoginPromtp設(shè)為false.
        5,設(shè)置連接完成。

      ==============================================================================

      8、如何判斷Treeview中我選中的節(jié)點(diǎn)是否有子節(jié)點(diǎn)?如果沒有給出提示啊?
      答:
      if Treeview.Selected.HasChildren then
      //有
      else
      //無

      var
      Node :TTreeNode;
      begin
      Node :=TreeView1.Selected;
      if Node.HasChildren then
      ....
      對(duì)復(fù)雜的程序最好用Node過渡

      ==============================================================================

      9、能否解釋一下try...except...end及try...finally...end;?
      1.(1)是用于撲捉異常,(2)是用于保證代碼執(zhí)行的完整性
      2.(1)中finally處的代碼不管什么情況都會(huì)被執(zhí)行,(2)中except處的代碼僅在發(fā)生異常時(shí)才會(huì)執(zhí)行
      3.try finally之間的代碼雖可保證finally 和 end之間的程序能執(zhí)行,但不能保證程序不崩潰,
      而try except就不會(huì)使程序崩潰

      ==============================================================================

      10、怎么樣在主程序控制器中加入音樂?
      在implementation下加入 mmsystem單元(windows多媒體函數(shù)動(dòng)態(tài)聯(lián)結(jié)庫)。然後在的onShow,onCreate事件中編寫代碼:sndplaysound('sound.wav',snd_async)

      ==============================================================================

      11、我在form1上有四個(gè)edit,輸完后我想用下上箭頭鍵進(jìn)行上移下移?怎么辦?
      答:
      procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
      begin
      if key=vk_down then perform(WM_NEXTDLGCTL,0,0) else
      if key=vk_up then perform(WM_NEXTDLGCTL,1,0);
      end;

      ==============================================================================

      12、如何用delphi5實(shí)現(xiàn)讀文本文件指定的一行,并得到文本文件的總行數(shù)?謝謝!
      答:
      Delphi讀文件文件一般使用Readln過程,如要讀第3行可以這樣:
      var
      i : Integer;
      F: TextFile;
      S: string;
      begin
      if OpenDialog1.Execute then { Display Open dialog box }
      begin
      AssignFile(F, OpenDialog1.FileName); { File selected in dialog }
      Reset(F);
      For i = 1 To 3 Do
      Readln(F, S);
      Edit1.Text := S; { Put string in a TEdit control }
      CloseFile(F);
      .
      end;
      要統(tǒng)計(jì)總行數(shù),只能從頭逐行讀,直到文件尾(Eof函數(shù)為True),每讀一行計(jì)數(shù)器加1。
      不過由于文本文件的每行長(zhǎng)度不相等,它不能象數(shù)據(jù)庫文件那樣想讀那行就讀哪行,只能順序讀。
      上面的方法容易理解,也容易實(shí)現(xiàn)。如果希望提高速度,編程上要麻煩一些,可以以二進(jìn)制方式打開文件,將所有內(nèi)容讀入一個(gè)內(nèi)存變量,然后使用Pos函數(shù)查找其中的回車(#13)個(gè)數(shù),這樣可以快速地統(tǒng)計(jì)總行數(shù)并能快速地找到指定行。

      ==============================================================================

      13、制作主窗口顯示前的版權(quán)窗口
      答:
      在工程文件中選File->New Form新建一個(gè)窗口,設(shè)計(jì)好窗口的外觀。給窗口起名為AboutBox,選Project->Options,將新建的窗口從自動(dòng)建立中去掉。選View->Project Source,打開工程文件的源文件,在下面加入紅色的句子。
      Uses AboutBox
      Var
      lTime :TDateTime;
      Begin
      Application.Initialize();
      AboutBox=TAboutBox.Create(AboutBox);
      AboutBox.Show;
      AboutBox.Update;
      lTime=GetTickCount;
      Application.CreateForm(TMainForm,MainForm);
      while((GetTickCount-lTime) / 1000 <3) do;
      AboutBox.Hide;
      AboutBox.Free;
      Application.Run;
      end;

      ==============================================================================

      14、Delphi中RichEdit的奧妙
        一、如何得知當(dāng)前行號(hào)   
        用RichEdit(或者memo)控件制作文本編輯器時(shí),通過訪問lines?count屬性可以得到總行數(shù),但是若想知道光標(biāo)當(dāng)前所在行的行號(hào)就麻煩了,因?yàn)閐elphi沒有提供這個(gè)屬性。要實(shí)現(xiàn)這個(gè)編輯器必備功能,就須調(diào)用em_ LineFromChar。

        請(qǐng)?jiān)囋囅旅娴某绦颉?br>  先在窗口中布置一個(gè)RichEdit或者memo(命名為editor),以及一個(gè)button。在button的onclick事件中寫入下列代碼。
         var
         CurrentLine:Integer;
         begin
           CurrentLine:=Editor.Perform(em_ LineFromChar,SFFFF,0);   
           Application.MessageBox(PChar(′當(dāng)前行號(hào)是′+I(xiàn)ntToStr(CurrentLine)),′消息′,mb_ iconinformation);   
         end;
        需要注意的是,第一行的行號(hào)為零。

        二、如何撤消操作(undo)
        對(duì)于memo來說,實(shí)現(xiàn)undo是不需編程的,只要讓popupmenu屬性為空,運(yùn)行時(shí)就能用鼠標(biāo)右鍵激活一個(gè)常用操作菜單,其中包括撤消、剪切、復(fù)制、粘貼、刪除和全選六項(xiàng)?! 〉上У氖?,這一招對(duì)于功能強(qiáng)大的RichEdit控件居然行不通,害得我們還要自己設(shè)計(jì)一個(gè)popupmemu。當(dāng)你用 CutToClipBoard等語句輕松而順利地完成了“剪切”等功能,接著便會(huì)無奈地發(fā)現(xiàn),竟找不到undo或cancel之類的語句來執(zhí)行“撤消”?! ∵@時(shí)你需要這樣處理:
          RichEdit1?Perform(EM_UNDO,0,0);
        另外還應(yīng)檢查是否允許撤消,從而開啟或關(guān)閉彈出菜單中的“撤消”項(xiàng):
          Undo1?Enabled:=RichEdit?
          Perform(EM_CANUNDO,0,0)<>0;   
      以上程序在Delphi3中調(diào)試通過?! ?/p>

      ==============================================================================

      15、在主窗口中打開另一個(gè)獨(dú)立的窗口,而這個(gè)被打開的窗口固定顯示在..?
      答:
      procedure TForm2.FormCreate(Sender: TObject);
      begin
      form2.Hide;
      self.Parent:=form1.Panel1;
      end;

      ==============================================================================

      16、SaveDialog1確認(rèn)文件存不存在的辦法?
      答:
      procedure TForm1.SaveDialog1CanClose(Sender: TObject;
      var CanClose: Boolean);
      begin
      if FileExists(SaveDialog1.FileName) then //如果文件已經(jīng)存在
      if MessageDlg('文件已經(jīng)存在,保存嗎?', mtConfirmation, [mbYes, mbNo], 0) <> mrYes then
      Button2.Click ; //如果選擇了覆蓋,則退出,否則,重新讓用戶選擇文件
      end;

      ==============================================================================

      17、正確關(guān)閉一個(gè)MDI子窗口?
      答:
      Delphi中MDI子窗口的關(guān)閉方式默認(rèn)為縮小而不是關(guān)閉,所以當(dāng)你單擊子窗口右上角的關(guān)閉按鈕時(shí)會(huì)發(fā)覺該子窗口只是最小化,而不是你預(yù)期的那樣被關(guān)閉。解決辦法是在子窗口的OnClose事件處理過程中加入如下代碼,示例:

      procedure ChildForm.OnClose(Sender: TObject; var Action: TCloseAction);
      begin
      Action := caFree;
      end;

        Delphi為一個(gè)Form的關(guān)閉行為指定了四種方式,分別是:

      caNone 禁止Form被關(guān)閉
      caHide Form不被關(guān)閉,但是被隱藏。被隱藏的Form仍然可以被程序訪問。
      caFree Form被關(guān)閉,并且釋放其占用的資源。
      caMinimize Form被最小化而不是被關(guān)閉,這是MDI子窗口的默認(rèn)關(guān)閉行為。

      ==============================================================================

      18、怎樣記MDI子窗口不在母體運(yùn)行時(shí)就被打開?
      答:
      在project下的options中forms里面除了form1外,其余的移到右邊的框里,然后在調(diào)用顯示的按鈕下編寫語句,以form2調(diào)用為例:
      form2:=Tform2.create(self);
      form2.show;

      ==============================================================================

      19、限制FORM的大小
      答:
      在FORM私有聲明部分加上如下一行:

      procedure WMGetMinMaxInfo( var Message:TWMGetMinMaxInfo );message WM_GETMINMAXINFO;
      在聲明部分加上如下幾行:
      procedure TForm1.WMGetMinMaxInfo( var Message :TWMGetMinMaxInfo );
      begin
      with Message.MinMaxInfo^ do
      begin
      ptMaxSize.X := 200; {最大化時(shí)寬度}
      ptMaxSize.Y := 200; {最大化時(shí)高度}
      ptMaxPosition.X := 99; {最大化時(shí)左上角橫坐標(biāo)}
      ptMaxPosition.Y := 99; {最大化時(shí)左上角縱坐標(biāo)}
      end;
      Message.Result := 0; {告訴Windows你改變了 minmaxinfo}
      inherited;
      end;

      ==============================================================================

      20、隨機(jī)數(shù)生成法
      答:
      Randomize;
      rn:=inttostr(random(9999));
      rn1:=inttostr(random(9999));
      .....

      ==============================================================================

      21、怎樣把程序隱藏起來,在WINDOWS界面上沒有顯示??
      答:
      在application.run之前加入application.showmain:=false!

      ==============================================================================

      22、怎樣將一個(gè)form1.free的form1窗體重新顯示?
      答:
      form2:=TForm2.Create(application);
      form2.Show;

      如果你要?jiǎng)?chuàng)建的Form2窗體能嵌入一個(gè)Panel中,指定Parent:
      form2:=TForm2.Create(application);
      form2.Parent:=panel1;
      form2.Show;

      ==============================================================================

      23、我想在bitbtn上設(shè)快捷按鈕Esc,怎么辦?
      答:
      procedure TForm1.BitBtn1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
      begin
      if key=27 then
      application.Terminate;
      end;

      設(shè)它的cancel屬性為true就行了~~

      ==============================================================================

      24、什么叫做托盤區(qū)?
      答:
      托盤區(qū)就是在windows的狀態(tài)欄下方顯示時(shí)鐘、輸入法狀態(tài)的地方,

      要把你的程序顯示在托盤區(qū):
      下面是一個(gè)托盤類,只要把下面粘貼到文本文件中,改成TrayIcon.pas,使用時(shí)uses TrayIcon就可以了。

      先聲明一個(gè)全局變量:
      var tray:TTrayNotifyIcon;

      然后在窗體的OnCreate事件中:
      tray:=TTrayNotifyIcon.Create(self);//將窗體創(chuàng)建為托盤
      tray.Icon:=application.Icon;//定義托盤的顯示圖標(biāo)
      tray.IconVisible:=true;//托盤可見
      tray.PopupMenu:=popmenu;//給托盤定義一個(gè)右擊時(shí)的彈出菜單
      tray.OnDblClick:=trayDblClick;//給托盤定義一個(gè)雙擊事件(當(dāng)然要自己寫了,不過多數(shù)情況只有一行,就是Form1.show);

      unit TrayIcon;

      interface

      uses Windows, SysUtils, Messages, ShellAPI, Classes, Graphics, Forms, Menus,
      StdCtrls, ExtCtrls;

      type
      ENotifyIconError = class(Exception);

      TTrayNotifyIcon = class(TComponent)
      private
      FDefaultIcon: THandle;
      FIcon: TIcon;
      FHideTask: Boolean;
      FHint: string;
      FIconVisible: Boolean;
      FPopupMenu: TPopupMenu;
      FonClick: TNotifyEvent;
      FOnDblClick: TNotifyEvent;
      FNoShowClick: Boolean;
      FTimer: TTimer;
      Tnd: TNotifyIconData;
      procedure SetIcon(Value: TIcon);
      procedure SetHideTask(Value: Boolean);
      procedure SetHint(Value: string);
      procedure SetIconVisible(Value: Boolean);
      procedure SetPopupMenu(Value: TPopupMenu);
      procedure SendTrayMessage(Msg: DWORD; Flags: UINT);
      function ActiveIconHandle: THandle;
      procedure OnButtonTimer(Sender: TObject);
      protected
      procedure Loaded; override;
      procedure LoadDefaultIcon; virtual;
      procedure Notification(AComponent: TComponent;
      Operation: TOperation); override;
      public
      constructor Create(AOwner: TComponent); override;
      destructor Destroy; override;
      published
      property Icon: TIcon read FIcon write SetIcon;
      property HideTask: Boolean read FHideTask write SetHideTask default False;
      property Hint: String read FHint write SetHint;
      property IconVisible: Boolean read FIconVisible write SetIconVisible default False;
      property PopupMenu: TPopupMenu read FPopupMenu write SetPopupMenu;
      property onClick: TNotifyEvent read FonClick write FonClick;
      property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
      end;

      implementation

      { TIconManager }
      { This class creates a hidden window which handles and routes }
      { tray icon messages }
      type
      TIconManager = class
      private
      FHWindow: HWnd;
      procedure TrayWndProc(var Message: TMessage);
      public
      constructor Create;
      destructor Destroy; override;
      property HWindow: HWnd read FHWindow write FHWindow;
      end;

      var
      IconMgr: TIconManager;
      DDGM_TRAYICON: Cardinal;

      constructor TIconManager.Create;
      begin
      FHWindow := AllocateHWnd(TrayWndProc);
      end;

      destructor TIconManager.Destroy;
      begin
      if FHWindow <> 0 then DeallocateHWnd(FHWindow);
      inherited Destroy;
      end;

      procedure TIconManager.TrayWndProc(var Message: TMessage);
      { This allows us to handle all tray callback messages }
      { from within the context of the component. }
      var
      Pt: TPoint;
      TheIcon: TTrayNotifyIcon;
      begin
      with Message do
      begin
      { if it’s the tray callback message }
      if (Msg = DDGM_TRAYICON) then
      begin
      TheIcon := TTrayNotifyIcon(WParam);
      case lParam of
      { enable timer on first mouse down. }
      { onClick will be fired by OnTimer method, provided }
      { double click has not occurred. }
      WM_LBUTTONDOWN: TheIcon.FTimer.Enabled := True;
      { Set no click flag on double click. This will supress }
      { the single click. }
      WM_LBUTTONDBLCLK:
      begin
      TheIcon.FNoShowClick := True;
      if Assigned(TheIcon.FOnDblClick) then TheIcon.FOnDblClick(Self);
      end;
      WM_RBUTTONDOWN:
      begin
      if Assigned(TheIcon.FPopupMenu) then
      begin
      { Call to SetForegroundWindow is required by API }
      SetForegroundWindow(IconMgr.HWindow);
      { Popup local menu at the cursor position. }
      GetCursorPos(Pt);
      TheIcon.FPopupMenu.Popup(Pt.X, Pt.Y);
      { Message post required by API to force task switch }
      PostMessage(IconMgr.HWindow, WM_USER, 0, 0);
      end;
      end;
      end;
      end
      else
      { If it isn’t a tray callback message, then call DefWindowProc }
      Result := DefWindowProc(FHWindow, Msg, wParam, lParam);
      end;
      end;

      { TTrayNotifyIcon }

      constructor TTrayNotifyIcon.Create(AOwner: TComponent);
      begin
      inherited Create(AOwner);
      FIcon := TIcon.Create;
      FTimer := TTimer.Create(Self);
      with FTimer do
      begin
      Enabled := False;
      Interval := GetDoubleClickTime;
      OnTimer := OnButtonTimer;
      end;
      { Keep default windows icon handy... }
      LoadDefaultIcon;
      end;

      destructor TTrayNotifyIcon.Destroy;
      begin
      if FIconVisible then SetIconVisible(False); // destroy icon
      FIcon.Free; // free stuff
      FTimer.Free;
      inherited Destroy;
      end;

      function TTrayNotifyIcon.ActiveIconHandle: THandle;
      { Returns handle of active icon }
      begin
      { If no icon is loaded, then return default icon }
      if (FIcon.Handle <> 0) then
      Result := FIcon.Handle
      else
      Result := FDefaultIcon;
      end;

      procedure TTrayNotifyIcon.LoadDefaultIcon;
      { Loads default window icon to keep it handy. }
      { This will allow the component to use the windows logo }
      { icon as the default when no icon is selected in the }
      { Icon property. }
      begin
      FDefaultIcon := LoadIcon(0, IDI_WINLOGO);
      end;

      procedure TTrayNotifyIcon.Loaded;
      { Called after component is loaded from stream }
      begin
      inherited Loaded;
      { if icon is supposed to be visible, create it. }
      if FIconVisible then
      SendTrayMessage(NIM_ADD, NIF_MESSAGE or NIF_ICON or NIF_TIP);
      end;

      procedure TTrayNotifyIcon.Notification(AComponent: TComponent;
      Operation: TOperation);
      begin
      inherited Notification(AComponent, Operation);
      if (Operation = opRemove) and (AComponent = PopupMenu) then
      PopupMenu := nil;
      end;

      procedure TTrayNotifyIcon.OnButtonTimer(Sender: TObject);
      { Timer used to keep track of time between two clicks of a }
      { double click. This delays the first click long enough to }
      { ensure that a double click hasn’t occurred. The whole }
      { point of these gymnastics is to allow the component to }
      { receive onClicks and OnDblClicks independently. }
      begin
      { Disable timer because we only want it to fire once. }
      FTimer.Enabled := False;
      { if double click has not occurred, then fire single click. }
      if (not FNoShowClick) and Assigned(FonClick) then
      FonClick(Self);
      FNoShowClick := False; // reset flag
      end;

      procedure TTrayNotifyIcon.SendTrayMessage(Msg: DWORD; Flags: UINT);
      { This method wraps up the call to the API’s Shell_NotifyIcon }
      begin
      { Fill up record with appropriate values }
      with Tnd do
      begin
      cbSize := SizeOf(Tnd);
      StrPLCopy(szTip, PChar(FHint), SizeOf(szTip));
      uFlags := Flags;
      uID := UINT(Self);
      Wnd := IconMgr.HWindow;
      uCallbackMessage := DDGM_TRAYICON;
      hIcon := ActiveIconHandle;
      end;
      Shell_NotifyIcon(Msg, @Tnd);
      end;

      procedure TTrayNotifyIcon.SetHideTask(Value: Boolean);
      { Write method for HideTask property }
      const
      { Flags to show application normally or hide it }
      ShowArray: array[Boolean] of integer = (sw_ShowNormal, sw_Hide);
      begin
      if FHideTask <> Value then
      begin
      FHideTask := Value;
      { Don’t do anything in design mode }
      if not (csDesigning in ComponentState) then
      ShowWindow(Application.Handle, ShowArray[FHideTask]);
      end;
      end;

      procedure TTrayNotifyIcon.SetHint(Value: string);
      { Set method for Hint property }
      begin
      if FHint <> Value then
      begin
      FHint := Value;
      if FIconVisible then
      { Change hint on icon on tray notification area }
      SendTrayMessage(NIM_MODIFY, NIF_TIP);
      end;
      end;

      procedure TTrayNotifyIcon.SetIcon(Value: TIcon);
      { Write method for Icon property. }
      begin
      FIcon.Assign(Value); // set new icon
      { Change icon on notification tray }
      if FIconVisible then SendTrayMessage(NIM_MODIFY, NIF_ICON);
      end;

      procedure TTrayNotifyIcon.SetIconVisible(Value: Boolean);
      { Write method for IconVisible property }
      const
      { Flags to add or delete a tray notification icon }
      MsgArray: array[Boolean] of DWORD = (NIM_DELETE, NIM_ADD);
      begin
      if FIconVisible <> Value then
      begin
      FIconVisible := Value;
      { Set icon as appropriate }
      SendTrayMessage(MsgArray[Value], NIF_MESSAGE or NIF_ICON or NIF_TIP);
      end;
      end;

      procedure TTrayNotifyIcon.SetPopupMenu(Value: TPopupMenu);
      { Write method for PopupMenu property }
      begin
      FPopupMenu := Value;
      if Value <> nil then Value.FreeNotification(Self);
      end;

      const
      { String to identify registered window message }
      TrayMsgStr = ’DDG.TrayNotifyIconMsg’;

      initialization
      { Get a unique windows message ID for tray callback }
      DDGM_TRAYICON := RegisterWindowMessage(TrayMsgStr);
      IconMgr := TIconManager.Create;
      finalization
      IconMgr.Free;
      end.

      ==============================================================================

      25、關(guān)于窗體釋放的問題(formX.free)?
      答:
      這個(gè)我知道,模式窗口用:form2 := TForm2.Create(Application);
      try
      if form2.showModal = mrOK then
      {do Something}
      finally
      form2.free;
      form2 := nil;
      end; 非模式窗口用:if not Assigned(form2) then
      form2 := Tfrom2.Create(Application);
      form2.show;

      //然后在form2的Close事件中加入以下句
      Action := caFree;

      //在from2的Destory事件中加入以下句
      form2 := nil; 搞定!!!

      ==============================================================================

      26、關(guān)于MDI窗體的問題?
      答:
      我不知道是如何實(shí)現(xiàn),但我知道一個(gè)方法可以實(shí)現(xiàn)同樣的功能,在打開子窗體前加一句
      button1.SendToBack;

      ==============================================================================

      27、小數(shù)點(diǎn)'.'的鍵號(hào)是什么?回車是#13,'.'是什么?
      答:
      你可以用此得出所有鍵的值procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
      begin
      label1.caption:=IntToStr(key);
      end;

      ==============================================================================
      ==============================================================================

      1、判斷機(jī)器是否網(wǎng)絡(luò)狀態(tài)
      答:
      uses WinInet;
      procedure TForm1.Button1Click(Sender: TObject);
      function GetOnlineStatus : Boolean;
      var ConTypes : Integer;
      begin
      ConTypes := INTERNET_CONNECTION_MODEM + INTERNET_CONNECTION_LAN + INTERNET_CONNECTION_PROXY;
      if (InternetGetConnectedState(@ConTypes, 0) = False)
      then Result := False
      else Result := True;
      end;
      begin
      if not GetOnlineStatus then ShowMessage('Not Connected');
      end;

      ==============================================================================

      2、[DELPHI]窗體漸漸出現(xiàn)
      答:
      AnimateWindow(Handle,1000,AW_CENTER);
      //在窗體創(chuàng)建事件中

      ==============================================================================

      3、如何取得一臺(tái)機(jī)器的CPU占用率???
      答:
      使用下面的方法
      interface

      uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;

      const
      SystemBasicInformation = 0;
      SystemPerformanceInformation = 2;
      SystemTimeInformation = 3;

      type
      TPDWord = ^DWORD;

      TSystem_Basic_Information = packed record
      dwUnknown1: DWORD;
      uKeMaximumIncrement: ULONG;
      uPageSize: ULONG;
      uMmNumberOfPhysicalPages: ULONG;
      uMmLowestPhysicalPage: ULONG;
      uMmHighestPhysicalPage: ULONG;
      uAllocationGranularity: ULONG;
      pLowestUserAddress: Pointer;
      pMmHighestUserAddress: Pointer;
      uKeActiveProcessors: ULONG;
      bKeNumberProcessors: byte;
      bUnknown2: byte;
      wUnknown3: word;
      end;

      type
      TSystem_Performance_Information = packed record
      liIdleTime: LARGE_INTEGER; {LARGE_INTEGER}
      dwSpare: array[0..75] of DWORD;
      end;

      type
      TSystem_Time_Information = packed record
      liKeBootTime: LARGE_INTEGER;
      liKeSystemTime: LARGE_INTEGER;
      liExpTimeZoneBias: LARGE_INTEGER;
      uCurrentTimeZoneId: ULONG;
      dwReserved: DWORD;
      end;

      var
      NtQuerySystemInformation: function(infoClass: DWORD;
      buffer: Pointer;
      bufSize: DWORD;
      returnSize: TPDword): DWORD; stdcall = nil;

      liOldIdleTime: LARGE_INTEGER = ();
      liOldSystemTime: LARGE_INTEGER = ();
      SysBaseInfo: TSystem_Basic_Information;
      SysPerfInfo: TSystem_Performance_Information;
      SysTimeInfo: TSystem_Time_Information;
      status: Longint; {long}
      dbSystemTime: Double;
      dbIdleTime: Double;
      function GetCPUUsage:Double;
      implementation
      function Li2Double(x: LARGE_INTEGER): Double;
      begin
      Result := x.HighPart * 4.294967296E9 + x.LowPart
      end;

      function GetCPUUsage:Double;
      var
      bLoopAborted : boolean;
      begin
      if @NtQuerySystemInformation = nil then
      NtQuerySystemInformation := GetProcAddress(GetModuleHandle(‘ntdll.dll‘),
      ‘NtQuerySystemInformation‘);
      // get number of processors in the system
      status := NtQuerySystemInformation(SystemBasicInformation, @SysBaseInfo, SizeOf(SysBaseInfo), nil);
      if status <> 0 then Exit;
      // Show some information
      {with SysBaseInfo do
      begin
      ShowMessage(
      Format(‘uKeMaximumIncrement: %d‘#13‘uPageSize: %d‘#13+
      ‘uMmNumberOfPhysicalPages: %d‘+#13+‘uMmLowestPhysicalPage: %d‘+#13+
      ‘uMmHighestPhysicalPage: %d‘+#13+‘uAllocationGranularity: %d‘#13+
      ‘uKeActiveProcessors: %d‘#13‘bKeNumberProcessors: %d‘,
      [uKeMaximumIncrement, uPageSize, uMmNumberOfPhysicalPages,
      uMmLowestPhysicalPage, uMmHighestPhysicalPage, uAllocationGranularity,
      uKeActiveProcessors, bKeNumberProcessors]));
      end;
      }
      bLoopAborted := False;
      while not bLoopAborted do
      begin
      // get new system time
      status := NtQuerySystemInformation(SystemTimeInformation, @SysTimeInfo, SizeOf(SysTimeInfo), 0);
      if status <> 0 then Exit;
      // get new CPU‘s idle time
      status := NtQuerySystemInformation(SystemPerformanceInformation, @SysPerfInfo, SizeOf(SysPerfInfo), nil);
      if status <> 0 then Exit;
      // if it‘s a first call - skip it
      if (liOldIdleTime.QuadPart <> 0) then
      begin
      // CurrentValue = NewValue - OldValue
      dbIdleTime := Li2Double(SysPerfInfo.liIdleTime) - Li2Double(liOldIdleTime);
      dbSystemTime := Li2Double(SysTimeInfo.liKeSystemTime) - Li2Double(liOldSystemTime);
      // CurrentCpuIdle = IdleTime / SystemTime
      dbIdleTime := dbIdleTime / dbSystemTime;
      // CurrentCpuUsage% = 100 - (CurrentCpuIdle * 100) / NumberOfProcessors
      dbIdleTime := 100.0 - dbIdleTime * 100.0 / SysBaseInfo.bKeNumberProcessors + 0.5;
      // Show Percentage
      //Form1.Label1.Caption := FormatFloat(‘CPU Usage: 0.0 %‘,dbIdleTime);
      //Application.ProcessMessage

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多