我正在尝试格式化文本以在MsgBox中显示,并且需要知道适当的字符大小。
是否有一种方法可以控制MsgBox中的格式。还是您知道MsgBox使用的字体和字体大小。
Function Pixels(Data) As Double
' Return sum of PIXEL_SIZES from the string "Data".
Knt = 0
Pixels = 0
For I = 1 To Len(Data)
Arg = Mid(Data, I, 1)
Char_Value = Asc(Arg)
If Char_Value >= 32 Or Char_Value <= 126 And Len(Arg) = 1 Then
Knt = Knt + 1
J = Char_Value - 32
Ptr = PIXEL_DATA(J)
Width_ = Text_Before(Ptr, "|")
Pixels = Pixels + Width_
Else
msg1 = "The char " & I & " is not an asci value:"
Msg2 = "The character value is " & Chr(Arg) & "."
Call Msg_Err(Prog, msg1, Msg2)
Stop
End If
Next I
End Function ' Pixels()