var mystring :TString; procedure Tmakefile.makefileclick(Sender:Tobject) begin mystring:=TString.Create(Self); mystring:='c:\read.txt'; If not fileExists(mystring) then ComboBox1.Text:=Memo1.Text; SaveDialog.Execute; SaveDialog.FileName:='read'+'.txt' Memo1.Lines.SaveToFile(SaveDialog1.FileName); else Memo1.Lines.LoadFromFile(mystring); ComboBox.Text:=Memo1.Text; end; 基本实现方法把要读写的文件给一个实例变量,把文件内容先装入MEMO。再把MEMO装入comboBox.text中。至于直接创建我还不会。呵。。我是写的要是无此文件。自动提示保存一个。
第:7条反了应该是:Memo1.Text:=ComboBox1.Text;
//动态添加 if key=char(13) then with combobox2 do if (text<>'') and (items.IndexOf(text)<0) then items.Add(text); 可是退出后我不知道如何保存
var mystring :TString; procedure Tmakefile.makefileclick(Sender:Tobject) begin mystring:=TString.Create(Self); mystring:='c:\read.txt'; If not fileExists(mystring) then Memo1.Text:=ComboBox1.Text; SaveDialog.Execute; SaveDialog.FileName:='read'+'.txt' Memo1.Lines.SaveToFile(SaveDialog1.FileName); else Memo1.Lines.LoadFromFile(mystring); ComboBox.Text:=Memo1.Text; end; 在系统自动实现加载如何实现,起码makefileclick的makefile要声明吗?click在那里控件的什么事件效果最好,
if key=char(13) then with combobox2 do if (text<>'') and (items.IndexOf(text)<0) then items.Add(text); SaveDialog.Execute; SaveDialog.FileName:='read'+'.txt' Memo1.Lines.SaveToFile(SaveDialog1.FileName); 可以了吧
procedure Tmakefile.makefileclick(Sender:Tobject)
begin
mystring:=TString.Create(Self);
mystring:='c:\read.txt';
If not fileExists(mystring) then
ComboBox1.Text:=Memo1.Text;
SaveDialog.Execute;
SaveDialog.FileName:='read'+'.txt'
Memo1.Lines.SaveToFile(SaveDialog1.FileName);
else
Memo1.Lines.LoadFromFile(mystring);
ComboBox.Text:=Memo1.Text;
end;
基本实现方法把要读写的文件给一个实例变量,把文件内容先装入MEMO。再把MEMO装入comboBox.text中。至于直接创建我还不会。呵。。我是写的要是无此文件。自动提示保存一个。
if key=char(13) then
with combobox2 do
if (text<>'') and (items.IndexOf(text)<0) then
items.Add(text);
可是退出后我不知道如何保存
procedure Tmakefile.makefileclick(Sender:Tobject)
begin
mystring:=TString.Create(Self);
mystring:='c:\read.txt';
If not fileExists(mystring) then
Memo1.Text:=ComboBox1.Text;
SaveDialog.Execute;
SaveDialog.FileName:='read'+'.txt'
Memo1.Lines.SaveToFile(SaveDialog1.FileName);
else
Memo1.Lines.LoadFromFile(mystring);
ComboBox.Text:=Memo1.Text;
end;
在系统自动实现加载如何实现,起码makefileclick的makefile要声明吗?click在那里控件的什么事件效果最好,
with combobox2 do
if (text<>'') and (items.IndexOf(text)<0) then
items.Add(text);
SaveDialog.Execute;
SaveDialog.FileName:='read'+'.txt'
Memo1.Lines.SaveToFile(SaveDialog1.FileName);
可以了吧