Mengetahui jika form adalah “modal”
procedure TForm1.Button1Click(Sender: TObject); begin if (fsModal in FormState) then ShowMessage(’Form is modal.’); end;
View ArticleSembunyikan tombol minimize/maximize pada form
procedure TForm1.FormCreate(Sender: TObject); var l: DWORD; begin l := GetWindowLong(Self.Handle, GWL_STYLE); l := l and not (WS_MINIMIZEBOX); l := l and not (WS_MAXIMIZEBOX); l :=...
View ArticleMembalik string/kalimat (Reverse String)
function ReverseString(const s: string): string; var i, len: Integer; begin len := Length(s); SetLength(Result, len); for i := len downto 1 do begin Result[len - i + 1] := s[i]; end; end;
View ArticleMengubah atribut properties File
procedure TForm1.Button1Click(Sender: TObject); begin with OpenDialog1 do if Execute then if SetFileAttributes(PChar(Filename), FILE_ATTRIBUTE_HIDDEN) then Caption:=’attribute was changed’ else...
View ArticleMengatur tanggal/waktu suatu file
procedure TForm1.Button1Click(Sender: TObject); begin if OpenDialog1.Execute then Edit1.Text:=OpenDialog1.FileName; end; procedure TForm1.Button2Click(Sender: TObject); var HFile: Word; MyDate:...
View Article