有没有一种方法可以将主题应用于转换后的Access 97表单?

有没有一种方法可以将主题应用于转换后的Access 97表单?

问题描述:

我将Access 97应用程序升级到Access 2010

I upgraded an access 97 application to access 2010

当我创建一个新表单时,就像一个主设计,我只需单击一下就可以将其应用于每个表单.此功能不适用于我的旧表格(不变).

When I create a new form, there's like a master design that I can apply on every forms with 1 click. This feature doesn't work on my old forms (Nothing change).

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

I tried to start with a blank database and import everything. Now the forms are a bit better looking cause the button are rounded and the font is better but I still can't change the labels background with the master design.

颜色就像每个标签的属性中的硬编码一样.我可以全部选择它们并进行更改,但对于每种形式我都必须这样做.有什么方法可以对旧表格使用主设计?

The color is like hard coded in the properties for every labels. I can select them all and change it but I will have to do it for every forms. Is there a way I can use a master design with my old forms?

谢谢.

主题前颜色使用以下属性应用于标签:

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

ForeThemeColorIndex
ForeTint
ForeShade

据我所知,当您从另一个未应用主题的数据库中导入表单时,对于某些控件,ForeThemeColorIndex值将设置为-1.这基本上告诉Access,这些控件具有硬编码"的颜色(尽管在VBA中不是).

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).

我在想解决此问题的唯一方法是使用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.

这是这些属性的列表.这不一定是全面的.我只是使用一个基本循环来查找标签控件的属性来拉动它.这些属性对于文本框控件是相同的.此列表的主题颜色已成功应用于我的名为lblLastName的标签控件:

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

以下是与此有关的一些Microsoft文档的链接: http://msdn.microsoft.com/en-us/library/office /ff195247.aspx

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