问题一:
现有一个textbox,允许显示多行。
for i=1 to 100
text1.text=text1.text & vbcrlf & i
doevents
next
上面代码可让文本框显示循环结果。。但是如果循环次数太多或者要显示的内容太多。。就会很慢慢。
有没有更快的办法代替:text1.text=text1.text & vbcrlf & i 这句?问题二:
现有窗口 Form1 当前窗口已设置最大化按钮失效。目的就是为了不让用户改变窗体大小。但是还是可以拉动窗口边缘来达到改变窗口大小的目的。如何让用户不能调整窗口大小?请高手一一解答。小弟感谢!

解决方案 »

  1.   

    1〉
    Dim s As String
    For i = 1 To 1000
        s = s & vbCrLf & i
    Next
    Text1.Text = s 我试了一下 这样子比直接text1.text=text1.text & i快
    2 form的bordersytle设为1
      

  2.   

    第二个问题我测试了。。
    form的bordersytle设为1
    后。连最小化按扭也没了。。我要有最小化按钮。
      

  3.   

    Dim x1 As Single
    Dim y1 As Single
    Dim sfw As Boolean
    Dim sfh As BooleanPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If X > Form1.Width - 100 Then
    sfw = True
    x1 = X
    Form1.Print "zoom1"
    End IfIf Y > Form1.Height - 100 Then
    sfh = True
    y1 = Y
    Form1.Print "zoom2"
    End IfEnd SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)If sfw Then
    Form1.Width = Form1.Width - (x1 - X)
    x1 = X'Label1.Caption = X
    'Label2.Caption = Form1.WidthEnd IfIf sfh Then
    Form1.Height = Form1.Height - (y1 - Y)
    y1 = Y
    End IfEnd SubPrivate Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    sfw = False
    sfh = FalseEnd Sub模仿windows y有边框
    第二个问题
      

  4.   

    第二个问题
    Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
         Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
         Private Const SC_SIZE = &HF000
         Private Const MF_BYCOMMAND = &H0&
         
        Private Sub Form_Load()
         Dim hMenu As Long, Success As Long
         
         hMenu = GetSystemMenu(Form1.hwnd, 0)
         Success = DeleteMenu(hMenu, SC_SIZE, MF_BYCOMMAND)
        End Sub
      

  5.   

    1、第一问:用定时器(Timer),否则数据多了,你的软件将处于不可控状态。Option Explicit
    Private iLimt As Long
    Private strTemp As String
    Private Sub Command1_Click()
        Timer1.Interval = 200
        Timer1.Enabled = True
        strTemp = Text1.Text
        iLimt = 1
    End SubPrivate Sub Timer1_Timer()    strTemp = strTemp & vbCrLf & iLimt
        iLimt = iLimt + 1
        Text1.Text = strTemp
        If iLimt > 100 Then
            Timer1.Interval = 0
            Timer1.Enabled = False
        End If
    End Sub2、第二问,设置属性:Form属性:    BorderStyle = 1
        MinButton = True