如何在visual basic 2012中制作按钮来改变形式(OOP方法) [英] how to make button to change form in visual basic 2012 (OOP method)

查看:85
本文介绍了如何在visual basic 2012中制作按钮来改变形式(OOP方法)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我正在研究使用visual studio 2012和SQL server 2012注册数据的程序。



我所制作的应用程序是:

我正在制作的注册表是注册大量数据(大约20-30个数据)所以我必须创建一个多表格来保存数据。



我想问的是:



我如何创建一个按钮,这样我可以在不关闭程序的情况下将一个表格转到另一个表格? br />


制作它的正确编码是什么?

hello, i'm working on program to register data using visual studio 2012 and SQL server 2012.

the application program i make is this:
the register form i'm making is to register a lot of data (around 20-30 data) so i have to create a multiple form to save the data.

what i want to ask is:

how do i create a button so i can go to one form to another form without closing the program?

what is the proper coding to make it?

推荐答案

您可以从按钮打开一个新表格非常容易:

You can open a new form from a button very easily:
Dim frm As New frmNewForm()
frm.MyProperty = value
frm.Show()



Or

Dim frm As New frmNewForm()
frm.MyProperty = value
frm.ShowDialog()

(第二个版本在新表格关闭之前不会返回)

但是......这是更难以切换,就像关闭应用程序的主窗体一样,整个应用程序将关闭。您可以模拟它:

(The second version won't return until the new form is closed)
But...It's harder to "switch" as if you close the main form for your app, the whole app will close. You can simulate it though:

Dim frm As New frmNewForm()
frm.MyProperty = value
Hide()
frm.ShowDialog()
Show()

要切换回,你关闭新的表单实例。



错字:不能为can:O [/ edit]

To "switch back", you close the new form instance.

[edit]Typo: "can't" for "can" :O [/edit]


这篇关于如何在visual basic 2012中制作按钮来改变形式(OOP方法)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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