设置Form2的属性:
BorderStyle = 3
ControlBox = False
Caption = ""
label1.Caption = "请等待..."在Form1中:
Private Sub Command1_Click()
    Dim t As Single
    
    Load Form2
    Form2.Width = 5000
    Form2.Height = 1000
    Form2.Show , Me
    
    t = Timer + 5
    Do While Timer < t
        DoEvents
    Loop
    Unload Form2
End Sub

解决方案 »

  1.   

    设置Form2的属性:
    BorderStyle = 0
    加入一个label1
    label1.Caption = "请等待..."在Form1中:
    Private Sub Command1_Click()
        me.visible = false
        form2.top = ...
        form2.left = ...
        Form2.Width = ...
        Form2.Height = ...
        Form2.Show    
        '在这里处理数据
    ...
        '处理完成后
        Unload Form2
        me.visible = true
    End Sub
      

  2.   

    这两个方法都不可行。
    form2必须是模态的
    但是当form2是模态的时候,form2得到了控制权。后台必须等待,而不是做一些操作之后,把form2 unload。
      

  3.   

    我觉得应该用api把form2置顶,不过我没有成功!
    关注!
      

  4.   

    如果必须是模态的,就直接在Form2里做你的事情,做完之后unload。
      

  5.   

    对呀,你用show 1将窗体显示为模态的。
      

  6.   

    我认为可以将form1置顶,用api,但我遇到一些问题,效果和我想的不一样。
    但我认为这个思路是对的。我现在也遇到这个问题,正在思考。
    欢迎探讨。
      

  7.   

    最近碰到高手指点,用Send Message解决。呵呵
    谢谢大家的讨论
      

  8.   

    如果用API可以这样做呀。Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Const GWL_HWNDPARENT = (-8)
    setwindowlong(form2.hwnd,GWL_HWNDPARENT,hwnd)
      

  9.   

    用setwindowpos将form2设置为最顶层后将焦点返回到form1