unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
ComboBox1: TComboBox;
procedure FormCreate(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure Edit2Change(Sender: TObject);
procedure ComboBox1Select(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
filename:String='
test.txt';
filepath:String='
c:\a\b\';
implementation
{$R *.dfm}
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
filename:=ExtractFileName(ComboBox1.Text);
filepath:=ExtractFileDir(ComboBox1.Text)+'
\';
Edit1.Text:=filename;
Edit2.Text:=filepath;
ComboBox1.Text:=filepath+filename;
end;
procedure TForm1.ComboBox1Select(Sender: TObject);
begin
filePath:=ComboBox1.Text;
Edit2.Text:=filepath;
ComboBox1.Text:=filepath+'
\'+filename;
showmessage(ComboBox1.Text);
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
filename:=Edit1.Text;
ComboBox1.Text:=filepath+filename;
end;
procedure TForm1.Edit2Change(Sender: TObject);
begin
filepath:=Edit2.Text;
ComboBox1.Text:=filepath+filename;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Text:=filename;
Edit2.Text:=filepath;
ComboBox1.Text:=filepath+filename;
end;
end.