vb richtextbox控件问题

来源:百度知道 编辑:UC知道 时间:2024/06/07 04:37:16
with frmPrint.Rct
.SelFontName = "中宋"
.SelBold = True
.SelAlignment = rtfCenter
.SelFontSize = 24
.SelText = "评估委托协议书" & Chr(13) & Chr(10)
.SelFontName = "中宋"
.SelBold = True
.SelAlignment = rtfLeft
.SelFontSize = 15
.SelText = "甲方:" & Chr(13) & Chr(10)
.SelFontName = "中宋"
.SelBold = True
.SelFontSize = 15
.SelAlignment = rtfLeft
.SelText = "乙方:" & Chr(13) & Chr(10)
end with
其中Rct是Richtextbox控件,大家帮我看看问题出在哪里?
我的本意是在加载窗体时,在Richtextbox控件里输入“评估委托协议书”(字体:宋体;大小:24;居中,粗体)然后换行输入“甲方:”(字体:宋体;大小:15;左对齐,粗体)然后换行输入“乙方:”(字体:宋体;大小:15;左对齐,粗体)但是运行的时候大小全都显示为24了,不知道为什么?

With Rct
.SelStart = 0
.SelFontName = "中宋"
.SelBold = True
.SelAlignment = rtfCenter
.SelFontSize = 24
.SelText = "评估委托协议书" & Chr(13) & Chr(10)
' .SelFontName = "中宋"
' .SelBold = True
.SelStart = 9
.SelAlignment = rtfLeft
.SelFontSize = 15
.SelText = "甲方:" & Chr(13) & Chr(10)
' .SelFontName = "中宋"
' .SelBold = True
.SelFontSize = 15
' .SelAlignment = rtfLeft
.SelText = "乙方:" & Chr(13) & Chr(10)
End With

你设置的是richtextbox的属性,当然是一样了,如果要分行来设置字体,都是通过Selection*属性来修改
http://www.baidu.com/s?ie=gb2312&bs=richbox&sr=&z=&cl=3&f=8&tn=baidu&wd=vb+richtextbox+%D7%D6%CC%E5&ct=0

with frmPrint.Rct
.SelFontName = "中宋&q