在Excel宏中,我试图确定形状的字体颜色是否是“自动”的。
如下图所示,如果ColorIndex是xlColorIndexAutomatic,则字体颜色被确定为“自动”。
但是,当我在Excel颜色面板中将字体颜色设置为黑色(颜色代码:0)时,ColorIndex设置为xlColorIndexAutomatic,因此无法区分黑色和“自动”。
如果有办法区分他们,请告诉我。
If ActiveSheet.Shapes(0).TextFrame.Characters.Font.ColorIndex = xlColorIndexAutomatic Then
'//
End If
在我的工作表中,第4栏中的单元格包含一个公式。有时公式返回一个数字,有时它返回字符串"data!“。对于后一个结果,我希望字体颜色更改为红色。以下事件处理程序代码失败:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
'font color red if error
If Target.Column = 4 Then
If Target = "data!" Then
Range("D" & T
我试图从父组件中重写子文本字段组件的字体颜色,但无法做到这一点,也不确定原因。我在https://codesandbox.io/s/twilight-waterfall-3okx4?file=/src/SearchBar.js上创建了一个简单的演示项目,其中在" FieldOne.js“中定义的"fieldone”CSS类将字体颜色设置为红色,而在我导入FieldOne.js子组件的SearchBar.js中定义的"fieldoneoverride“CSS类将字体颜色设置为绿色。因为我是一个ReactJS新手,希望有人能提供一些关于我做错了什么的见解。提前感谢! Se
对于我的JS html5类,我正在尝试创建一个网页,允许用户选择背景颜色,以及他们是想使用SANS SERIF字体还是SANS字体。我有工作的背景颜色--
var inputColor = prompt( "Enter a color name for the " +
"background of this page", "" );
document.body.setAttribute( "style", "background-color: " + inputColor );
我不知道如何使用相同的想法,