vb.net自动实例化(窗体) [英] vb.net auto instantiation (forms)

查看:308
本文介绍了vb.net自动实例化(窗体)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VB.Net中,您可以在不使用对象引用的情况下显示表格,然后再... vb.net对您进行引用,但是,功能"产生了许多问题,例如:

In VB.Net you can show a form without crete an object reference before... vb.net do it to you, but, that "feature" is generating many problems, eg:

Public Class Form1

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    Form3.Show()
End Sub
End Class

Public Class Form3
    Inherits System.Windows.Forms.Form
End Class

有什么方法可以禁用此功能吗?

Is there any way to disable this?

推荐答案

没有办法禁用它.它称为默认实例.如果您不想使用它-不要使用它.我建议创建一个新实例.

No there is no way to disable that. It is called the default instance. If you don't want to use it - don't use it. I recommend creating a new instance.

Dim f3 As New Form3
f3.Show()

这篇关于vb.net自动实例化(窗体)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆