我写的delphi在打开文件后状态栏不显示文件名
unitUnit4;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,F...
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm4 = class(TForm)
Memo1: TMemo;
Button1: TButton;
Button2: TButton;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
ColorDialog1: TColorDialog;
FontDialog1: TFontDialog;
Button3: TButton;
Button4: TButton;
StatusBar1: TStatusBar;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
{$R *.dfm}
procedure TForm4.Button1Click(Sender: TObject);
begin
if opendialog1.Execute then
memo1.Lines.LoadFromFile(opendialog1.FileName);
statusbar1.SimpleText:= opendialog1.FileName; //要求显示打开文件的信息
end;
procedure TForm4.Button2Click(Sender: TObject);
begin
if savedialog1.Execute then
memo1.Lines.SaveToFile(savedialog1.FileName);
end;
procedure TForm4.Button3Click(Sender: TObject);
begin
if fontdialog1.Execute then
memo1.Font:=fontdialog1.Font;
end;
procedure TForm4.Button4Click(Sender: TObject);
begin
if colordialog1.Execute then
memo1.Color:=colordialog1.Color;
end;
end. 展开
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm4 = class(TForm)
Memo1: TMemo;
Button1: TButton;
Button2: TButton;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
ColorDialog1: TColorDialog;
FontDialog1: TFontDialog;
Button3: TButton;
Button4: TButton;
StatusBar1: TStatusBar;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
{$R *.dfm}
procedure TForm4.Button1Click(Sender: TObject);
begin
if opendialog1.Execute then
memo1.Lines.LoadFromFile(opendialog1.FileName);
statusbar1.SimpleText:= opendialog1.FileName; //要求显示打开文件的信息
end;
procedure TForm4.Button2Click(Sender: TObject);
begin
if savedialog1.Execute then
memo1.Lines.SaveToFile(savedialog1.FileName);
end;
procedure TForm4.Button3Click(Sender: TObject);
begin
if fontdialog1.Execute then
memo1.Font:=fontdialog1.Font;
end;
procedure TForm4.Button4Click(Sender: TObject);
begin
if colordialog1.Execute then
memo1.Color:=colordialog1.Color;
end;
end. 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询