vb文本编辑器打开代码的问题
colog1.Filter="文本文件|*.txt"colog1.ShowSavefn=colog1.FileNameOpenfnForOutputAs#1Write#1...
colog1.Filter = "文本文件|*.txt"
colog1.ShowSave
fn = colog1.FileName
Open fn For Output As #1
Write #1, s, fontname1, fontsize1, fontbold1, fontitalic1, backclolor1, foreclolor1, underline1, strikethru1
Text1 = s
Close #1
我像这样保存了文件,但打开了却和保存的时候不一样
colog1.Filter = "文本文件|*.txt"
colog1.ShowOpen
Text1.Text = ""
fn = colog1.FileName
Open fn For Input As #1
Do While Not EOF(1)
Line Input #1, s1
s = s & s1 & Chr(13) & Chr(10)
Loop
Text1 = s
这个打开的代码该怎么修改,请教大神 展开
colog1.ShowSave
fn = colog1.FileName
Open fn For Output As #1
Write #1, s, fontname1, fontsize1, fontbold1, fontitalic1, backclolor1, foreclolor1, underline1, strikethru1
Text1 = s
Close #1
我像这样保存了文件,但打开了却和保存的时候不一样
colog1.Filter = "文本文件|*.txt"
colog1.ShowOpen
Text1.Text = ""
fn = colog1.FileName
Open fn For Input As #1
Do While Not EOF(1)
Line Input #1, s1
s = s & s1 & Chr(13) & Chr(10)
Loop
Text1 = s
这个打开的代码该怎么修改,请教大神 展开
展开全部
Private Sub Command1_Click()
colog1.Filter = "文本文件|*.txt"
colog1.ShowSave
fn = colog1.FileName
s = "ok"
fontname1 = "simsun"
fontsize1 = 7
fontbold1 = "true"
fontitalic1 = "false"
backclolor1 = "red"
foreclolor1 = "blue"
underline1 = "true"
strikethru1 = "false"
Open fn For Output As #1
Write #1, s, fontname1, fontsize1, fontbold1, fontitalic1, backclolor1, foreclolor1, underline1, strikethru1
Text1 = s
Close #1
'我像这样保存了文件,但打开了却和保存的时候不一样
colog1.Filter = "文本文件|*.txt"
colog1.ShowOpen
Text1.Text = ""
fn = colog1.FileName
Open fn For Input As #1
Do While Not EOF(1)
Line Input #1, s1
s = s & s1 & Chr(13) & Chr(10)
Loop
Text1 = s
End Sub
关键是没有赋值.所有的全部是空.
更多追问追答
追问
不是赋值的问题 ,我保存好了(文本编辑器),在电脑自带的文本编辑器显示的是
“123”“36”“”···“red” 这样的文字 (我保存的是36号字的“123”,红色的背景 ) 但是打开的时候还是“123”“36”“”···“red”这样
我是想问怎么该才能在我做的文本编辑器打开的时候只看到36号字的“123”还有红色背景??
追答
我有点明白你的意思了,你是想保存带有一个36号红色的字。这是不可能的,TXT只能保存文字。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询