还没想到更好的方法解决label的autosize的问题,只好写了下面的代码,一般在短的,符号不多的字符串中误差可以接受。。。没法子
Label1.Text = TextBox1.Text
        
For i = 1 To Label1.Text.Length
            
If Asc(Mid(TextBox1.Text, i, 1)) > 31 And Asc(Mid(TextBox1.Text, i, 1)) < 126 Then
                cout 
= cout + 1
            
Else
                cout 
= cout + 2
            
End If
        
Next
        Label1.Width 
= 120 * cout
posted on 2004-12-21 15:23  xyocj  阅读(571)  评论(0编辑  收藏  举报