edit
兴建 打开 保存 另存为 |
这四个command,
先编写表单的active事件代码
with this.edit1 .top=0 .left=0 .width=this.width endwith set exact on this.caption="未命名" this.edit1.setfocus
再写command1的click的代码:
thisform.edit1.value="" thisform.refresh thisform.caption="未命名" thisform.edit1.setfocus
thisform.command2.enabled=.t.
thisform.command3.enabled=.f.
thisform.command4.enabled=.t.
再写command2的
cfile=getfile("") nhandle=fopen(cfile) nend=fseek(nhandle,0,2)=fseek(nhandle,0,0) thisform.edit1.value=fread(nhandle,nend) thisform.caption=cfile=fclose(nhsndle) thisform.edit1.setfocus thisform.refresh thisform.command3.enabled=.t.
再写command3的
cfile=thisform.caption nhandle=fopen(cfile,1)=fwrite(nhandle,thisform.edit1.value)=fclose(nhandle) thisform.refresh thisform.edit1.setfocus
再写command4的
cfile=putfile("") nhandle=fcreate(cfile,0) cc=fwrite(nhandle,thisform.edit1.value)=fclose(nhandle) thisform.edit1.setfocus thisform.refresh thisform.command3.enabled=.t. 自己写的,可以运行的,希望大家看看,写的不好,哈哈