12 June 2007

MEMBUAT PROGRAM SAVE AND LOAD

Semoga berhasil... Jika ada masalah kirim email ke : putu_dalungcity@yahoo.co.id

Nama : Abryan Tata Pangarsa
Web : abryantp.blogspot.com

Sourcecode [ Membuat program save and load ] :

unit Abryan;

interface

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

type
TForm1 = class(TForm)
Memo1: TMemo;
ComboBox1: TComboBox;
ListBox1: TListBox;
RadioGroup1: TRadioGroup;
CheckListBox1: TCheckListBox;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
XPManifest1: TXPManifest;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
Memo1.Lines.LoadFromFile(OpenDialog1.FileName );
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if SaveDialog1.Execute then
Memo1.Lines.SaveToFile(SaveDialog1.FileName );
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
ComboBox1.Items.LoadFromFile('Test.txt');
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
ComboBox1.Items.SaveToFile('test.txt');
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
CheckListBox1.Items.LoadFromFile('Test.txt');
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
ListBox1.Items.LoadFromFile('Test.txt');
end;

procedure TForm1.Button7Click(Sender: TObject);
begin
RadioGroup1.Items.LoadFromFile('Test.txt');
if RadioGroup1.Items.Count > 5 then
RadioGroup1.Columns :=2;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Memo1.Clear ;
end;

end.

 

Copyright © 2009 Fresh Themes Gallery | NdyTeeN. All Rights Reserved. Powered by Blogger and Distributed by Blogtemplate4u .