补上空格,如下面的方法
如果要让这个数字占10个字符的位置
strnum=space(10-len(cstr(num))) & cstr(num)

解决方案 »

  1.   

    中文当然有。用Format$(num,"@@@@@@@@@@")也不行,多少个@算一个字符呀。我在VB里面有时是四个算一个空格,有时是5个算一个空格。没法用。我的VB是繁体
      

  2.   

    用Tab试试
    str=chr(9) & num
      

  3.   

    Dim tmpX As Single
        Dim tmpStr As String
        With Printer
            .CurrentX = tmpX - .TextWidth(tmpStr)
            Printer.Print tmpStr
        End With
        其中tmpx是你要打印的对齐的坐标
      

  4.   

    先要判断你中文的字数
    Public Function longer(ByVal str As String) As Integer
    Dim i As Integer
    Dim j As Integer
    j = 0
    For i = 1 To Len(str)
    If Asc(Mid(str, i, 1)) < 0 Then j = j + 1
      Next i
      longer = j
    End Function然后根据中文补空格,因为一个中文等于两个英文字母