打印本文 打印本文 关闭窗口 关闭窗口
[VB.NET]浅谈MDI窗体的多窗体编程2
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2158  更新时间:2009/4/23 19:00:39  文章录入:mintao  责任编辑:mintao
    Private Sub ToolBar1_ButtonClick()Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
        Select Case
e.Button.Text
            Case "OK"  ''''"OK" is ToolBarButton.Text

                If fr Is Nothing Or fr.IsDisposed Then
                    fr = New frmName
                    With
fr
                        .MdiParent =
Me
                        .Show()
                    End With

                Else
                    With fr
                        .MdiParent =
Me
                        .Show()
                        .Focus()
                    End With

                End If
        End Select
    End Sub
所以大家使用的时候要当心点
分析,就是关闭了实例了一次的窗口后,fr is nothing ,所以fr是不被with所使用的,改了with的使用范围之后就没有错误出现.
---end---

上一页  [1] [2] 

打印本文 打印本文 关闭窗口 关闭窗口