摘要:
procedure DelFiles(f: string); var SearchRec: TSearchRec; begin ChDir(ExtractFilePath(f)); //进入文件路径 FindFirst(f, faAnyFile, SearchRec); repeat if FileExists(SearchRec.Name) then begi... 阅读全文
摘要:
procedure TForm1.Memo1Click(Sender: TObject); begin Text := Format('当前列:%d, 当前行:%d', [Memo1.CaretPos.X, Memo1.CaretPos.Y]); end; //用 API 实现 procedure TForm1.Memo1Click(Sender: TObject); var Line... 阅读全文
摘要:
//让 Edit 只接受数字 //方法1: procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if not (Key in ['0'..'9']) then Key := Chr(0); end; //方法2: procedure TForm1.Edit1KeyPress(Sender: T... 阅读全文