Entri Populer

Rabu, 28 Maret 2012

Aplikasi Memo


dibawah ini adlah listing aplikasi memo. silahkan mencoba 

unit Memo;


interface


uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, Menus;


type
  TForm1 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    MainMenu1: TMainMenu;
    f1: TMenuItem;
    exit1: TMenuItem;
    Memo1: TMemo;
    Panel1: TPanel;
    Button3: TButton;
    Button4: TButton;
    ComboBox3: TComboBox;
    ComboBox4: TComboBox;
    ComboBox1: TComboBox;
    GroupBox2: TGroupBox;
    RadioGroup1: TRadioGroup;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    RadioButton4: TRadioButton;
    RadioButton5: TRadioButton;
    RadioButton6: TRadioButton;
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    CheckBox3: TCheckBox;
    CheckBox4: TCheckBox;
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ComboBox3Change(Sender: TObject);
    procedure ComboBox4Change(Sender: TObject);
    procedure ComboBox1Change(Sender: TObject);
    procedure exit1Click(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
    procedure CheckBox3Click(Sender: TObject);
    procedure CheckBox2Click(Sender: TObject);
    procedure CheckBox4Click(Sender: TObject);
    procedure RadioButton1Click(Sender: TObject);
    procedure RadioButton2Click(Sender: TObject);
    procedure RadioButton3Click(Sender: TObject);
    procedure RadioButton4Click(Sender: TObject);
    procedure RadioButton5Click(Sender: TObject);
    procedure RadioButton6Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;


var
  Form1: TForm1;


implementation

{$R *.dfm}

procedure TForm1.Button3Click(Sender: TObject);
begin
memo1.Text:=uppercase(edit1.Text);
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
memo1.Text:=lowercase(edit1.Text);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
combobox3.Items:=screen.Fonts;
combobox3.Text:='-Pilih Fonts-';
combobox4.Text:='-Pilih Background-';
combobox1.Text:='-Pilih Fonts Size-';
end;

procedure TForm1.ComboBox3Change(Sender: TObject);
begin
memo1.Font.Name:=combobox3.Text;
end;

procedure TForm1.ComboBox4Change(Sender: TObject);
begin
if combobox4.Text='Red' then
   memo1.Color:=clred;
if combobox4.Text='Green' then
   memo1.Color:=clgreen;
if combobox4.Text='Yellow' then
   memo1.Color:=clyellow;
if combobox4.Text='Puple' then
   memo1.Color:=clpurple;
if combobox4.Text='Black' then
   memo1.Color:=clblack;
if combobox4.Text='Blue' then
   memo1.Color:=clblue;
if combobox4.Text='White' then
   memo1.Color:=clwhite;
if combobox4.Text='Gray' then
   memo1.Color:=clGray;
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
memo1.Font.Size:=strtoint(combobox1.Text);
end;

procedure TForm1.exit1Click(Sender: TObject);
begin
application.Terminate;
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
If CheckBox1.Checked=True then
   Begin
   Memo1.Font.Style :=Memo1.Font.Style+[FsBold];
   CheckBox1.Caption:='Un Bold';
   End
 Else
 Begin
  CheckBox1.Caption:='Bold';
  Memo1.Font.Style := Memo1.Font.Style-[FsBold];
 End
end;

procedure TForm1.CheckBox3Click(Sender: TObject);
begin
If CheckBox3.Checked=True then
   Begin
   Memo1.Font.Style :=Memo1.Font.Style+[FsItalic];
   CheckBox3.Caption:='Un Italic';
   End
 Else
 Begin
  CheckBox3.Caption:='Italic';
  Memo1.Font.Style := Memo1.Font.Style-[FsItalic];
 End
end;

procedure TForm1.CheckBox2Click(Sender: TObject);
begin
If CheckBox2.Checked=True then
   Begin
   Memo1.Font.Style :=Memo1.Font.Style+[FsUnderline];
   CheckBox2.Caption:='Un Line';
   End
 Else
 Begin
  CheckBox2.Caption:='Underline';
  Memo1.Font.Style := Memo1.Font.Style-[FsUnderline];
 End
end;

procedure TForm1.CheckBox4Click(Sender: TObject);
begin
If CheckBox4.Checked=True then
   Begin
   Memo1.Font.Style :=Memo1.Font.Style+[FsStrikeOut];
   CheckBox4.Caption:='Un Stikethrough';
   End
 Else
 Begin
  CheckBox4.Caption:='Stikethrough';
  Memo1.Font.Style := Memo1.Font.Style-[FsStrikeOut];
 End
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;

procedure TForm1.AboutMe1Click(Sender: TObject);
begin
Form2.show;
end;

end.

sekian listing yang telah saya posting. jika ada kesalahan tolong di maafkan daon mohon memberikan info untuk kesalahannya di comment saya. maaf gambar tidak bisa diposting karena laptop saya keburu crash. hehehehehe...

Tidak ada komentar:

Posting Komentar