访问选项卡控件在隐藏页面时前景色更改。

huangapple go评论79阅读模式
英文:

Access Tab Control fore color changes when hiding pages

问题

在Access中,我有一个名为tbIMD的TabControl。

背景颜色为#604C78,
前景颜色为#F3F0F6,
悬停颜色为#F3F0F6,
悬停前景颜色为#604C78,
按下颜色为#FDFDFD,
按下前景颜色为#604C78。

当我通过VBA隐藏一个页面时,每当我点击一个页面,所有其他页面的前景颜色都会变成按下前景颜色,这意味着背景颜色和前景颜色现在相同,因此无法阅读文本。

代码如下:

如果DLookup("Purchased", "ItemCategoryT", "ItemCatID = " & Me.ItemCategory) = True Then
Me.pgPurchaseInfo.Visible = True

否则
    Me.pgPurchaseInfo.Visible = False

End If

我做错了什么?

英文:

In Access, I have a TabControl called tbIMD.

The Back color is #604C78,
The Fore color is #F3F0F6,
The Hover color is #F3F0F6,
The Hover Fore color is #604C78,
The Pressed color is #FDFDFD,
The Pressed Fore color is #604C78.

The moment I hide a page via VBA, anytime I click on a page, all of the other pages' fore colors changes to the Pressed Fore color, which means that the back color and fore colors are now the same, so you can't read the text.

The code is as follows:

If DLookup("Purchased", "ItemCategoryT", "ItemCatID = " & Me.ItemCategory) = True Then
    Me.pgPurchaseInfo.Visible = True
    
    Else
        Me.pgPurchaseInfo.Visible = False
End If

What am I doing wrong?

答案1

得分: 0

Ok, so I have been searching and searching and even ChatGPT can't help with an answer...

What I did was create a similar tab control and then just hide the tab control based on the criteria, instead of hiding the pages.

This seems to have solved my problem.

I would however love to know why it does this and whether there is actually a solution...

英文:

Ok, so I have been searching and searching and even ChatGPT can't help with an answer...

What I did was create a similar tab control and then just hide the tab control based on the criteria, instead of hiding the pages.

This seems to have solved my problem.

I would however love to know why it does this and whether there is actually a solution...

huangapple
  • 本文由 发表于 2023年8月4日 23:37:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76837377.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定