Delphi程式設計
2015年9月10日 星期四
視窗元件跟著放大縮小
›
uses System.TypInfo, Vcl.ComCtrls type TForm1 = class(TForm) private { Private declarations } var OW,OH,OP: Longint; ...
2014年3月3日 星期一
delphi dbgrid 多選實現
›
procedure TForm3.dbgrd1CellClick(Column: TColumn); //shift 多選 begin if (dgmultiselect in dbgrd1.options) then if getkeysta...
2014年1月29日 星期三
字串轉數字的小技巧
›
最常用的 strtoint() 或是 strtofloat() 或是 strtocurr() 不過這會有個問題 如果使用者輸入的不是數字的話,就會出現錯誤 一般習慣是會用 try except ..來處理 但是Delphi裡面有function可以處理這個問題,不用再使...
2014年1月27日 星期一
字串-format的用法
›
var text : string; begin // Just 1 data item ShowMessage( Format ('%s', ['Hello'])); // A mix of literal text ...
2014年1月24日 星期五
檢查是否為正確的Mac Address格式
›
function isMacAdrFormat(str: String): boolean; begin Result := False; if Length(str) <> 17 then Exit; Result :...
讓程式不能重覆開啟
›
//專案檔最前面加上,1.檢查Mutex,若XMonitor已存在,則離開。 if ProgramAlreadyExists() then exit; function ProgramAlreadyExists(): boolean ; var ...
判斷磁碟機是否有效
›
function ValidDrive( driveletter: Char ): Boolean; var mask: String[ 6 ]; sRec: TSearchRec; oldMode: Cardinal; retcode:...
›
首頁
查看網路版