如何在c#中切换表单? [英] how to switch between forms in c# ?
本文介绍了如何在c#中切换表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在c#中切换表格?
我发现这个视频显示了我想要的内容但是在vb中如何在c#中做同样的想法? ????
视频链接 [< a href =http://www.youtube.com/watch?v=fisfegXxxvAtarget =_ blanktitle =New Window> ^ ]
how to switch between forms in c# ??
I found this video that show exactly what I want but in vb how to do the same think in c#?????
video link [^]
推荐答案
也许,通过切换你的意思是激活,当你点击表格时会发生这种情况。以编程方式,您可以致电:
http: //msdn.microsoft.com/en-us/library/system.windows.forms.form.activate.aspx [ ^ ]。
-SA
Probably, by "switch" you mean activation, which happens when you click on the form. Programmatically, you can call:
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.activate.aspx[^].
—SA
我怀疑你的问题不仅仅是''在表单之间切换',因为它是''我如何拥有一个数据库实例让我可以从2个表单中访问数据 - ' - 所以它是一个架构问题
...为此,你真的需要看''MVC''或者这样,所以你的数据库不是强烈地绑定一个/任何形式,而是可以从代码中的任何地方访问
''g''
I suspect your issue isnt so much as ''switching between forms'' as it is ''how do I have an instance of a database so that I can access the data from 2 forms'' - - so its an architectural issue
... and for that, you really need to look at ''MVC'' or such, so your database isnt strongly ''tied to'' one/any form but accessable from anywhere in your code
''g''
创建数据抽象层 - DAL(google it) - 在表单之间传递此实例或使用一个静态/全局实例
''g''
Create a Data-Abstraction-Layer - DAL (google it) - either pass an instance of this between forms or use a static/global instance
''g''
这篇关于如何在c#中切换表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文