在RichTextBox中将选择的文本设置为粗体 [英] Set a selection of text to bold inside a RichTextBox
问题描述
在报表上的MS-Access RichTextBox中,我要选择粗体文本.
In an MS-Access RichTextBox on a Report, I want to make a selection of the text bold.
我发现此帖子在论坛上,该论坛说明了如何在VB6中执行此操作.我在MS-Access中尝试了相同的方法,但都将普通的Access文本框的Text Format
属性设置为Rich Text
,并且将Microsoft Forms 2.0 TextBox
通过ActiveX Controls
对话框添加了,但都无效.
I found this post on a forum which explains how to do this in VB6. I tried the same in MS-Access, both with a normal Access textbox with the Text Format
property set to Rich Text
and a Microsoft Forms 2.0 TextBox
added via the ActiveX Controls
dialogue box, neither works.
我知道VBA很大程度上基于VB6,所以我的逻辑是,如果可以在VB6中完成,那么我应该能够在Access中做到这一点.
I know VBA is based heavily on VB6 so my logic is if it can be done in VB6, I should be able to do it in Access.
我是对的吗?是否可以在MS-Access上的RichTextBox内将选择的文本设置为粗体?
Am I right? Is it possible to set a selection of text to bold inside a RichTextBox on MS-Access?
推荐答案
您没有提到Access的版本,对于2007(AFAIK)和2010,您可以创建一个文本框并将数据"选项卡上的文本格式"设置为丰富"文本.然后,您可以将控制源设置为:
You do not mention the version of Access, for 2007 (AFAIK) and 2010, you can create a textbox and set the Text Format on the data tab to Rich Text. You can then set the Control Source to:
="The quick <b>brown</b> fox"
在表格设计中,备忘录数据类型具有富文本格式"选项.
In table design, the memo data type has a Rich Text option.