标题:[原创] 自做一个文本编辑器
只看楼主
asdliu
Rank: 1
等 级:新手上路
帖 子:175
专家分:0
注 册:2004-4-21
 问题点数:0 回复次数:2 
[原创] 自做一个文本编辑器

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. 自己写的,可以运行的,希望大家看看,写的不好,哈哈

搜索更多相关主题的帖子: 文本编辑 
2004-04-22 11:55
龙门雪
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2004-7-20
得分:0 
怎么运行啊?不能啊!
2004-07-20 13:56
miluxh
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-12-30
得分:0 
2006-12-30 16:48



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-560-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.008478 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved