Time of Update: 2018-12-07
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); end;var Form1:
Time of Update: 2018-12-07
代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); end; {此介面聲明了一個 Name 屬性;
Time of Update: 2018-12-07
問題來源: http://www.cnblogs.com/del/archive/2008/01/17/1043226.html#1548952使用 Delphi 提供的 TTrayIcon 類, 兩三行程式甚至不寫程式(設計時選擇幾下)即可實現.設計時的準備工作:1、添加 TTrayIcon、TPopupMenu 控制項, TPopupMenu 用於托盤的右鍵菜單.2、隨意給 TPopupMenu 添加些功能表項目.代碼檔案:unit Unit1;interfaceuses Windows,
Time of Update: 2018-12-07
本例:代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB;type TForm1 = class(TForm) DBGrid1: TDBGrid; DataSource1: TDataSource;
Time of Update: 2018-12-07
代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); end; IMyInterface1 =
Time of Update: 2018-12-07
本例:代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB;type TForm1 = class(TForm) DBGrid1: TDBGrid; DataSource1: TDataSource;
Time of Update: 2018-12-07
問題來源: http://www.cnblogs.com/del/archive/2009/05/15/1458017.html#1549351代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, AppEvnts;type TForm1 = class(TForm)
Time of Update: 2018-12-07
Group By本來 Group By 也可以根據多個欄位分組("," 隔開), 但這個例子只有 Continent 欄位適合分組, 也只有 Area、Population 欄位適合統計.本例:代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids,
Time of Update: 2018-12-07
問題來源: http://www.cnblogs.com/del/archive/2009/06/05/1496857.html#1549294TTrayIcon 的主要屬性:TrayIcon.Icon指定托盤表徵圖, 有幾種用法:1、設計時選擇;2、把一個 TIcon 對象給它;3、使用當前程式表徵圖: TrayIcon1.Icon := Application.Icon;4、TrayIcon1.SetDefaultIcon; 這也是使用當前程式表徵圖.TrayIcon.Icons 與
Time of Update: 2018-12-07
代碼檔案://分組條件可以是 Whereprocedure TForm1.Button1Click(Sender: TObject);begin with ADODataSet1 do begin Close; CommandText := 'SELECT Continent, AVG(Area) AS 平均面積 ' + 'FROM country WHERE Continent="South America" GROUP BY
Time of Update: 2018-12-07
看了 InputBox、InputQuery 函數實現的源碼, 有些收穫與心得...通過 InputBox 可擷取使用者輸入的字串:procedure TForm1.Button1Click(Sender: TObject);var str: string;begin str := InputBox('輸入視窗標題', '輸入提示', '預設輸入內容'); ShowMessage(str); //顯示輸入的內容end;InputBox 是調用了 InputQuery,
Time of Update: 2018-12-07
//只要前五條記錄procedure TForm1.Button1Click(Sender: TObject);begin with ADODataSet1 do begin Close; CommandText := 'SELECT TOP 5 * FROM country'; Open; end;end;//去除重複procedure TForm1.Button2Click(Sender: TObject);begin with ADODataSet1 do
Time of Update: 2018-12-07
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB;type TForm1 = class(TForm) DBGrid1: TDBGrid; DataSource1: TDataSource;
Time of Update: 2018-12-07
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject);
Time of Update: 2018-12-07
之前, 有朋友誇過我: 博文通俗易懂, 能把複雜的問題簡單化; 希望我對介面的理解也能對大家有所協助; 不過其中個人理解的成分多些, 錯誤之處萬望指出."介面" 的概念和 "類" 特別是 "抽象類別" 近似, Delphi 之初並沒有介面, 後來(Delphi 3)為了支援 COM 引入了介面, 再後來發展成為 Delphi 重要的語言特性.應該先簡單瞭解點 COM, 說到 COM, 能讓我想到 "有心栽花花不活, 無意插柳柳成蔭" 的古話.微軟在開發 OLE 時, 有一種需求:
Time of Update: 2018-12-07
Where 用來指定查詢條件;Like 和 Not Like 來指定模糊條件;模糊條件中:_ 表示任一字元;% 表示任一字串;[] 表示一個集合.本例:代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB;type TForm1
Time of Update: 2018-12-07
第一個例子的操作實況錄影: Interface_Test.rar代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton;
Time of Update: 2018-12-07
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure
Time of Update: 2018-12-07
//一個前置樣本:{建立一 Win32 工程, 給表單添加 OnKeyDown 事件}procedure Tbu.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin Self.Text := Char(Key);end;{功能: 在鍵盤上按一個鍵, 表單的標題列會顯示鍵名}//現在我們用訊息方法重新實現這個功能unit Unit1;interfaceuses Windows, Messages,
Time of Update: 2018-12-07
代碼檔案:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; procedure