APA YANG TERJADI HARI INI...?

Radio Online

KABAR TEKNOLOGI TERAKHIR

Membuat Form Properties Text

seperti yang kita tau, sebuah text di dalam sebuah program word processor mempunyai properti yang kita bisa atur semau kita.. apakan ukurannya, tebal tipisnya maupun warnanya. kali ini kita buat simulasi properti text dengan delphi 7.

pertama buat form seperti di bawah :




kedua, ketikan code pada listing code hingga seperti berikut :

private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
  nonaktif;
  bersih;
combobox1.Items:=screen.Fonts;
  combobox1.Text:='-PILIH FONTS-';
  combobox2.Text:='-PILIH SIZE-';
  combobox3.Text:='-PILIH BACK COLOR-';
  combobox4.Text:='-PILIH STYLE-';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
memo1.Text:=uppercase(Edit1.Text);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
memo1.Text:=lowercase(Edit1.Text);
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
memo1.Font.Name:=combobox1.Text;
end;
procedure TForm1.ComboBox2Change(Sender: TObject);
begin
memo1.Font.Size:=strtoint(combobox2.Text);
end;
procedure TForm1.ComboBox3Change(Sender: TObject);
begin
if combobox3.Text='Merah' then
  memo1.Color:=clred
  else if combobox3.Text='Biru' then
  memo1.Color:=clblue
  else memo1.Color:=clgreen;
end;
procedure TForm1.ComboBox4Change(Sender: TObject);
begin
if combobox4.Text='Bold' then
  memo1.Font.Style:=memo1.Font.Style+[fsBold]
  else if combobox4.Text='Italic' then
  memo1.Font.Style:=memo1.Font.Style+[fsItalic]
  else if combobox4.Text='Underline' then
  memo1.Font.Style:=memo1.Font.Style+[fsUnderline]
  else if combobox4.Text='StrikeOut' then
  memo1.Font.Style:=memo1.Font.Style+[fsStrikeOut]
  else
  memo1.Font.Style:=memo1.Font.Style-[fsBold,fsItalic,fsUnderline,fsStrikeOut];
end;
procedure TForm1.RadioButton1Click(Sender: TObject);
begin
memo1.Font.Color:=clred;
end;
procedure TForm1.RadioButton2Click(Sender: TObject);
begin
  memo1.Font.Color:=clgreen;
end;
procedure TForm1.RadioButton3Click(Sender: TObject);
begin
memo1.Font.Color:=clyellow;
end;
procedure TForm1.RadioButton4Click(Sender: TObject);
begin
memo1.Font.Color:=clpurple;
end;
procedure TForm1.RadioButton5Click(Sender: TObject);
begin
memo1.Font.Color:=clblack;
end;
procedure TForm1.RadioButton6Click(Sender: TObject);
begin
memo1.Font.Color:=clblue;
end;
tton5Click(Sender: TObject);
begin
application.Terminate;
end;
end.

Penulis : eko supriyanto ~ Sebuah blog yang menyediakan berbagai macam informasi

Artikel Membuat Form Properties Text ini dipublish oleh eko supriyanto pada hari Sabtu, 14 April 2012. Semoga artikel ini dapat bermanfaat.Terimakasih atas kunjungan Anda silahkan tinggalkan komentar.sudah ada 0 komentar: di postingan Membuat Form Properties Text
 

0 komentar:

Posting Komentar