3

我将 access 97 应用程序升级为 access 2010

当我创建一个新表单时,就像一个主设计,我可以一键应用到每个表单。此功能不适用于我的旧表单(没有任何变化)。

在此处输入图像描述

我试图从一个空白数据库开始并导入所有内容。现在表单看起来更好一些,因为按钮是圆形的并且字体更好,但我仍然无法使用主设计更改标签背景。

颜色就像在每个标签的属性中硬编码一样。我可以全部选择并更改它,但我必须为每种表格都这样做。有没有办法可以将主设计与旧表格一起使用?

谢谢你。

4

3 回答 3

4

Theme fore colors are applied to labels using the following properties:

ForeThemeColorIndex
ForeTint
ForeShade

As near as I can tell, when you import a form from a different database where themes were not applied, the ForeThemeColorIndex value will be set to -1 for some controls. This basically tells Access that these controls have a color that's "hard coded" (though not in VBA).

I'm thinking the only way to fix this problem is to use VBA to open each form in design view, loop through all of the form's controls, and if the control is a label control (or any other control you're having trouble with), apply your theme colors using the correct theme-related properties. Once you've set the control to use theme colors, changing or applying themes should work without a hitch.

Here's a list of these properties. This is not necessarily comprehensive. I just pulled this using a basic loop looking at properties for a label control. These properties are the same for textbox controls. This list is with theme colors applied successfully to my label control named lblLastName:

lblLastName: BackThemeColorIndex=1
lblLastName: BackTint=100
lblLastName: BackShade=100
lblLastName: BorderThemeColorIndex=0
lblLastName: BorderTint=50
lblLastName: BorderShade=100
lblLastName: ThemeFontIndex=1
lblLastName: ForeThemeColorIndex=0
lblLastName: ForeTint=75
lblLastName: ForeShade=100
lblLastName: GridlineThemeColorIndex=1
lblLastName: GridlineTint=100
lblLastName: GridlineShade=65

Here's a link to some of Microsoft's Documentation on this: http://msdn.microsoft.com/en-us/library/office/ff195247.aspx

于 2012-10-29T21:08:50.800 回答
1

尝试在设计模式下打开表单,然后按 ctrl-a 选择所有对象。然后从设计选项卡上的功能区中,只需单击主题并选择图片显示的主题。

请记住,如果您使用 mdb,该选项将被禁用,因此您必须使用较新的 accDB 格式才能使用此选项。

于 2012-10-29T18:13:51.380 回答
-2

解决此问题的一种方法是将(旧)自动套用格式命令添加到快速访问工具栏。虽然它不会将主题功能添加到表单中,但它是一种以相当快速和一致的方式重新格式化表单的快速方法。

于 2018-08-23T17:03:12.597 回答