显示隐藏表格 [英] Show Hidden Form

查看:115
本文介绍了显示隐藏表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取像Form1一样的隐藏对象的参考当我尝试从Form2显示

Form1时,我无法获得对同一实例的引用。

我可以显示新Form1'但我不能取消隐藏我隐藏的那个

再次感谢Imagelist答案。它工作

How do I Get a ref to my hidden Object like a Form1 When I try to Show the
Form1 from Form2 I can not get a reference to the same instance.
I can Show New Form1''s but I cant unhide The one I Hid
Thanks again for the Imagelist Answer. it worked

推荐答案

Jim,


你能展示一些代码,因为这似乎有点奇怪。

一个表格可以用作MDI孩子,MDI父母,有show和showdialog。

所有人都有不同的使用方法(得到父母和

孩子们。


Cor
Jim,

Can you show some code, because this seems a little bit strange.
A form can be used as MDI child, MDI parent, with show and showdialog.
All have different ways of using them (getting the parents and the
children).

Cor


不是MDI

在vb6中代码将是。

如果您有两个Form Form1和Form2并且您使用Form1启动


Private Sub Button1_Click()''" Button on form1"

Form2.Show

me.Hide

End Sub


Private Sub Button1_Click( )在form2上的按钮

Form1.Show''Form1将显示在表单上输入的任何信息之前

我称为隐藏。

卸载我

结束子


在.net中我必须将Form2变为新Form2

Form2.Show

我的?如果我隐藏Form1或Form2的实例我如何访问隐藏的

表单。而不是它的新实例。

" Cor Ligthert" <无************ @ planet.nl>在消息中写道

新闻:**************** @ TK2MSFTNGP09.phx.gbl ...
Not MDI
in vb6 Code would be.
If you have two Forms Form1 and Form2 and you startup with Form1

Private Sub Button1_Click() ''"Button on form1"
Form2.Show
me.Hide
End Sub

Private Sub Button1_Click() "Button on form2
Form1.Show '' Form1 would show with any info entered on the form before
I Called Hide.
Unload Me
End Sub

In .net I have to Dim Form2 as New Form2
Form2.Show
My ? is If I hide an instance of Form1 or Form2 How can I access the Hidden
Form. And not a New Instance of it.
"Cor Ligthert" <no************@planet.nl> wrote in message
news:Of****************@TK2MSFTNGP09.phx.gbl...
Jim,<你能展示一些代码吗,因为这看起来有点奇怪。
一个表单可以用作MDI子,MDI父,show和showdialog。
所有都有不同的方式使用它们(得到父母和
孩子)。

Cor
Jim,

Can you show some code, because this seems a little bit strange.
A form can be used as MDI child, MDI parent, with show and showdialog.
All have different ways of using them (getting the parents and the
children).

Cor



Jim,


这方面有很多可能性,但在我看来这是最简单的



\\\

Me.Hide()

Dim frm2 As New Form2

frm2.ShowDialog(me )

frm2.Dispose()

Me.Show()

///


我希望这有帮助吗?


Cor
Jim,

There are a lot of posibilities for this, however this is in my opinon the
most easy one in this case.

\\\
Me.Hide()
Dim frm2 As New Form2
frm2.ShowDialog(me)
frm2.Dispose()
Me.Show()
///

I hope this helps?

Cor


这篇关于显示隐藏表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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