Delphi 기술 집합
4062 단어 Delphi
1. 다른 프로그램, 파일을 여는 방법:
uses ShellAPI;
ShellExecute(Application.Handle, nil, PChar(FilePath), nil, nil, SW_SHOWNORMAL);
2. 파일 또는 폴더 디렉토리를 찾습니다.
uses ShellAPI;
ShellExecute(Application.Handle, nil, PChar('explorer.exe'),PChar('/e, '+ '/select,' + FilePath), nil, SW_NORMAL);
다른
1. 숫자만 입력할 수 있도록 제한
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if not (key in ['0'..'9',#8,#13]) then
key:=#0;
end;
2, N 분 전 시간
var
pDate:TDate;
NowTime:String;
begin
pDate:=now();
pDate:=pDate-10/24/60; //10
NowTime:=FormatDateTime('yyyy-mm-dd hh:mm:ss',pDate);
end;
3, StringGrid 오른쪽 클릭 선택 테이블
procedure TFGLGL.StringGrid1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
MousePos: TSmallPoint;
begin
if Button = mbRight then
begin
MousePos.x := x;
MousePos.y := y;
SendMessage(StringGrid1.Handle, WM_LBUTTONDOWN, 0, MAKELONG(x, y));
SendMessage(StringGrid1.Handle, WM_LBUTTONUP, 0, MAKELONG(x, y));
end;
end;
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Delphi 목마 자기 복제법 구현목마가 자기 복사를 실현하는 원리는 프로그램이 실행될 때 먼저 자신이 특정 디렉터리에 있는지 확인하고 그렇지 않으면 계속 실행하며 그렇지 않으면 특정 디렉터리에 복사한 다음에 새로운 프로그램을 실행하고 낡은 프로그램...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.