Program Dengan PopupMenu (delphi7)

Berikut ini saya berbagi tutorial Program Dengan PopupMenu pada peprogram borland delphi 7, untuk para newbie program ini sangat mudah dimengerti. langsung aja ke Tutorialnya :

Link download

Via Mediafire :
> Download<

Via 4Shared
>Download<


Listing Lengkap :



-=====================Begin Code==============.
 unit Unit1;
 //http://olvandra.blogspot.com //
 //http://meanddelphi.blogspot.com //
interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    PopupMenu1: TPopupMenu;
    Panel1: TPanel;
    Blue1: TMenuItem;
    N1: TMenuItem;
    Red1: TMenuItem;
    N2: TMenuItem;
    Yellow1: TMenuItem;
    N3: TMenuItem;
    Green1: TMenuItem;
    N4: TMenuItem;
    Black1: TMenuItem;
    N5: TMenuItem;
    White1: TMenuItem;
    Shape1: TShape;
    Shape2: TShape;
    Shape3: TShape;
    Shape4: TShape;
    Shape5: TShape;
    Shape6: TShape;
    Shape7: TShape;
    Shape8: TShape;
    Shape9: TShape;
    Shape10: TShape;
    Shape11: TShape;
    Panel2: TPanel;
    Shape12: TShape;
    PopupMenu2: TPopupMenu;
    FontSizeUp1: TMenuItem;
    N6: TMenuItem;
    FontSizeDownd1: TMenuItem;
    UnderlineFont1: TMenuItem;
    ItalicFont1: TMenuItem;
    N9: TMenuItem;
    FontSizeNormal1: TMenuItem;
    StrikeFont1: TMenuItem;
    N7: TMenuItem;
    N8: TMenuItem;
    Bold1: TMenuItem;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure Blue1Click(Sender: TObject);
    procedure Red1Click(Sender: TObject);
    procedure Yellow1Click(Sender: TObject);
    procedure Green1Click(Sender: TObject);
    procedure Black1Click(Sender: TObject);
    procedure White1Click(Sender: TObject);
    procedure UnderlineFont1Click(Sender: TObject);
    procedure ItalicFont1Click(Sender: TObject);
    procedure FontSizeUp1Click(Sender: TObject);
    procedure FontSizeDownd1Click(Sender: TObject);
    procedure FontSizeNormal1Click(Sender: TObject);
    procedure StrikeFont1Click(Sender: TObject);
    procedure Bold1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Blue1Click(Sender: TObject);
begin
panel1.Color:=clblue;
panel2.Caption:='BIRU';
panel2.Font.Color:=clblue;
end;

procedure TForm1.Red1Click(Sender: TObject);
begin
panel1.Color:=clRed;
panel2.Caption:='MERAH';
end;

procedure TForm1.Yellow1Click(Sender: TObject);
begin
panel1.Color:=clYellow;
panel2.Caption:='KUNING';
end;

procedure TForm1.Green1Click(Sender: TObject);
begin
panel1.Color:=clGreen;
panel2.Caption:='HIJAU';
end;

procedure TForm1.Black1Click(Sender: TObject);
begin
panel1.Color:=clBlack;
panel2.Caption:='HITAM';
end;

procedure TForm1.White1Click(Sender: TObject);
begin
panel1.Color:=clWhite;
panel2.Caption:='PUTIH';
end;

procedure TForm1.UnderlineFont1Click(Sender: TObject);
begin
panel2.font.Style:=panel2.Font.Style+[fsUnderline];
end;

procedure TForm1.ItalicFont1Click(Sender: TObject);
begin
panel2.font.Style:=panel2.Font.Style+[fsItalic];
end;

procedure TForm1.FontSizeUp1Click(Sender: TObject);
begin
panel2.font.Size:=(panel2.font.Size)+3;
end;

procedure TForm1.FontSizeDownd1Click(Sender: TObject);
begin
panel2.font.Size:=(panel2.font.Size)-3;
end;

procedure TForm1.FontSizeNormal1Click(Sender: TObject);
begin
panel2.font.Size:=8;
panel2.font.Style:=panel2.Font.Style-[fsStrikeOut];
panel2.font.Style:=panel2.Font.Style-[fsBold];
panel2.font.Style:=panel2.Font.Style-[fsUnderline];
panel2.font.Style:=panel2.Font.Style-[fsItalic];

end;

procedure TForm1.StrikeFont1Click(Sender: TObject);
begin
panel2.font.Style:=panel2.Font.Style+[fsStrikeOut];
end;

procedure TForm1.Bold1Click(Sender: TObject);
begin
panel2.font.Style:=panel2.Font.Style+[fsBold];
end;

end.

.=====================END Code =====================.

Leave a Reply

Silahkan Tulis Komentar Anda, Sopan dan Berwibawa