如何做到在某文本框出现数值时自动附带上%
ivate Sub Text1_Change(Index As Integer)Style = "text-align:center;"
Text1(10).Text = Int((Text3(1).Text / Text1(8).Text) / 100) * 100
Dim z, a, b, c, d, e, f As Double
z = Val(Text3(1).Text)
a = Val(Text1(10).Text)
b = Val(Text1(8).Text)
c = Val(Text1(3).Text)
d = Val(Text1(4).Text)
e = Val(Text1(2).Text)
f = Val(Text1(0).Text)
If a = 0 Then Exit Sub
Text1(4).Text = Format(((c - b) / b) * 100, "0.0")
Text1(2).Text = Format(f - z)
Text1(0).Text = Format(c * a)
End Sub
我想在Text1(4).Text = Format(((c - b) / b) * 100, "0.0") 后面加上% ,让这个文本框的数值附带上%,并且保留小数点1位,能想到的都试了,比如format(数值表达式,"0.00%") 、Format(((c - b) / b) * 100, "0.0") & "%" 、Format(((c - b) / b) * 100, "####0.0") & "%"这些都试过了,都不成功!
最终想达到的效果http://pic.wenwen.
[ 本帖最后由 gu3669 于 2011-5-7 03:25 编辑 ]