表单的新实例

扫码查看
本文介绍了表单的新实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题是当我每次以新的形式调用此子对象时,都会创建该子对象
但是我想如果打开frmcompanylist然后将焦点设置在它上,如果
没有打开,然后打开一个新的instencse
而且每次我想
设置frmcompanylist =无

验证码:

problem is when i call this sub its create every time a new new instencse of form
but i want if frmcompanylist is opend then set focus to it and if
not opend then open a new instencse
and also every time i want to
set frmcompanylist =nothing

exp code:

private frmcompanylist as companylistform
Public Sub Show(ByVal FormName As String)
    Select Case FormName
         Case
            If frmcompanylist Is Nothing Then
                Set frmcompanylist = New CompanyListForm
            End If
            frmcompanylist.Show 1
            Set frmcompanylist = Nothing
   end select
end sub

推荐答案

Private Shared frmcompanylist As companylistform = Nothing


这篇关于表单的新实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 19:38
查看更多