1. 在form_resize的事件中加
 textbox.left=0
 textbox.top=0
 textbox.width=form.width
 textbox.height=form.height

解决方案 »

  1.   

    如何在VB中实现Undo(撤消)功能? 
    在许多应用程序中,例如许多编辑软件都有UNDO功能。它给我们带来了方便。那么在VB中能不能实现UNDO功能呢?答案是肯定的。下面介绍一下对于标准的文本框或组合框实现UNDO功能的示例代码。
    Declare Function SendMessage Lib"user"(ByVal hWnd As Integer,ByVal wMsg As Integer,wParam As Integer,lparam As Any) As Long
    Global Const WM_USER=&h400
    Global Const EM_UNDO=WM_USER+23
    UndoResult=SendMessage(myControl.hWnd,EM_UNDO,0,0)
      

  2.   

    form_resize()
     textbox.left=0
     textbox.top=0
     textbox.width=form.width
     textbox.height=form.height
    end sub
      

  3.   

    form_resize()
     textbox1.left=0
     textbox1.top=0
     textbox1.width=me.scalewidth
     textbox1.height=me.scaleheight
    end sub 
     
    用SendMessage函数前最好检查一下是否可以撤消:
    用EM_CANUNDO这个消息
    另:这种方法只能撤消一次。
    到Http://www.21code.net去看看,应该会有无限撤消的例子。