Mempercantik Tampilan Form dengan Hint


Tips & Trik Delphi, Tips Belajar Delphi, Belajar Delphi Online
unit Unit1;

 

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Label1: TLabel;
StatusBar1: TStatusBar;
procedure FormCreate(Sender: TObject);
procedure tampilkanhint(Sender: TObject);

private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.tampilkanhint(Sender: TObject);
begin
label1.Caption:=application.Hint;
StatusBar1.SimpleText:=application.Hint;
caption:=application.Hint;
end;

procedure
TForm1.FormCreate(Sender: TObject);
begin
application.ShowHint:=true;
application.OnHint:=tampilkanhint;
end;

end.

TransCODE Software
Iklan

Aplikasi Memanggil Ms Office dengan Delphi


Tips & Trik Delphi, Tips Belajar Delphi, Belajar Delphi Onlie
unit Unit1;


interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Shellapi,StdCtrls;

type
TForm1 = class(TForm)
Btn1: TButton;
Btn2: TButton;
Btn3: TButton;
Btn4: TButton;
procedure Btn1Click(Secnder: TObject);
procedure Btn2Click(Sender: TObject);
procedure Btn3Click(Sender: TObject);
procedure Btn4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Btn1Click(Sender: TObject);
begin
ShellExecute(handle, ‘Open’, ‘C:\Program Files\Microsoft Office/Office11/Winword.exe’, NiL,NiL, SW_SHOWNORMAL);
end;

procedure TForm1.Btn2Click(Sender: TObject);
begin
ShellExecute(handle, ‘Open’, ‘C:\Program Files\Microsoft Office/Office11/excel.exe’, NiL,NiL, SW_SHOWNORMAL);
end;

procedure TForm1.Btn3Click(Sender: TObject);
begin
ShellExecute(handle, ‘Open’, ‘C:\Program Files\Microsoft Office/Office11/Powerpnt.exe’, NiL,NiL, SW_SHOWNORMAL);
end;

procedure TForm1.Btn4Click(Sender: TObject);
begin
ShellExecute(handle, ‘Open’, ‘C:\Program Files\Microsoft Office/Office11/Msaccess.exe’, NiL,NiL, SW_SHOWNORMAL);
end;

end.

TransCODE Software

Kirim Email dengan delphi


Tips & Trik Delphi, Tips Belajar Delphi, Belajar Delphi Online
unit callMail;

 

 

interface

uses

Windows, Mengesang, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,StdCtrls,ShellApi;  type

TForm1 = class(TForm)

Button1: TButton;

Label1: TLabel;

procedure Button1Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

{$R *.DFM}

procedure
TForm1.Button1Click(Sender: TObject);

var

strTujuan, strSubject, strIsi,Param : String;

begin

strTujuan := ‘iklanwaluyo@Gmail.com‘;

strSubject := ‘Subject‘;

strIsi := ‘Isi Text‘;

Param :=’mailto:’ + strTujuan + ‘?subject=’ + strSubject +’&Body=’ +    strIsi;

ShellExecute(Form1.handle,’open’,PChar(Param),nil,nil,SW_SHOWNORMAL);

end;

end.

TransCODE Software