某个字段里有很多汉字,在规定的一行里输入不下,当输出16个字的时候,就要换到下一行输出剩下的汉字,如何实现?

解决方案 »

  1.   

    在TextBOX的属性页中设置其属性
    MultiLine为True
    ScrollBars为2
    并调整一行正好输入16个汉字。 
      

  2.   

    Dim s As Integer
    Dim value As IntegerPrivate Sub Form_Load()
    value = 16'改成你要换行的数值
    End SubPrivate Sub Text1_Change()If ((Len(Text1.Text) + 1) Mod (value + 2)) Mod (value + 1) = 0 Then
        SendKeys "{Enter}"
    End IfEnd Sub
      

  3.   

    我是用Printer.Print实现的,楼上说的好象不对吧
      

  4.   

     function prt(str1 as string)
      if len(str1)<=16 then
         Printer.Print str1
      else 
         Printer.Print left(str1,16)
         call prt(mid(str1,17)
      endif
    end function
      

  5.   

    没必要用递归,直接计算位置就可以了
    sub PrintStr(byval s as string)
        dim i as long
        for i=1 to len(s) step 16
            printer.print mid$(s,i,16)
        next
    end sub