如何更改文本颜色.简单的? [英] How to change the text color. Simple?

查看:29
本文介绍了如何更改文本颜色.简单的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

If CDbl(totalAverage) >= 89 Then
            lblGrade.Text = "A"
        ElseIf CDbl(totalAverage) >= 79 Then
            lblGrade.Text = "B"
        ElseIf CDbl(totalAverage) >= 69 Then
            lblGrade.Text = "C"
        ElseIf CDbl(totalAverage) >= 59 Then
            lblGrade.Text = "D"
        ElseIf CDbl(totalAverage) >= 0 Then
            lblGrade.Text = "F"
        End If

只是尝试将 A、B 或 C 的文本颜色更改为绿色.D 为橙色,F 为红色.

Just trying to change the colors of the text to green for an A, B, or C. Orange for a D, and red for an F.

我以为是 lblGrade.Text.Color 或类似的东西;然而,这似乎不是一个命令,我一直在环顾四周,但无法找到答案,并认为在这里提问会更容易.感谢您的帮助

I was thinking it was lblGrade.Text.Color or something like that; however, that didn't seem to be a command and I've been looking around and was having trouble finding the answer to this and thought it would be easier to just ask here. Thanks for the help

推荐答案

lblGrade.Forecolor 正是您要找的.

lblGrade.Forecolor is what your looking for.

对于橙色,它将是lblGrade.ForeColor = Color.Orange"

For orange, it would be "lblGrade.ForeColor = Color.Orange"

这篇关于如何更改文本颜色.简单的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆