隐藏MDI表格 [英] Hiding MDI forms

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

问题描述

我的MDI父表单上有一个计时器。如果设定的分钟数没有鼠标移动

,则所有打开表单的Visible属性为

设置为False,并显示登录表单。我可以在VB6中完成。


在VB2005中,我可以得到所有打开表单的列表,但是在隐藏第一个表单后我收到错误




这就是我正在尝试使用的:


For My m in My.Application.OpenForms

如果m.Name<> " frmMain"然后

m.Visible = False

结束如果

下一个m


它赢了''如果其中一个子表单显示另一个模式表单,则列出所有打开的表单。再一次,一旦它隐藏了第一个表单,它就会爆炸

- 关于我的OpenForms集合的变化。

解决方案

Kevin,


我试图避开我的命名空间,它主要是为VB6开发人员创建的,

虽然已经有很好的解决方案,但是在我的意见减少

当您想要使用OOP时会感到困惑。 (在某些情况下,我的命名空间有

方便的功能,所以不要理解我的错误。)


在你的父母中,你可以使用mdichildren而不是openforms

http://msdn2.microsoft.com/en-us/lib...ichildren.aspx

这个msdn页面让我感到困惑。它必须是me.mdichildren或者只是

mdichildren


MDI表单周围有更多属性,这些属性对你来说很容易。

你忙什么,


我希望这会有所帮助,


Cor

" Kevin" <柯**** @ cfl.rr.com> schreef在bericht

新闻:2h ******************************** @ 4ax.com ...

我的MDI父表单上有一个计时器。如果在设定的分钟数内没有鼠标移动,则所有打开表单的Visible属性将设置为False,并显示登录表单。我可以在VB6中完成。

在VB2005中,我可以获得所有打开表单的列表,但是在隐藏第一个表单后我收到错误。
这就是我正在尝试使用的:

对于每一个我在My.Application.OpenForms
如果m.Name<> " frmMain"然后
m.Visible = False
结束如果
下一个m

如果其中一个子表单显示



我也试过了。唯一的问题是,我似乎无法以模态方式打开一个

MDIChild表单。我必须让他们以非子形式打开

他们模态,所以他们不会在MDIChildren集合中结束。

2006年6月24日星期六07 :16:02 + 0200,Cor Ligthert [MVP]

< no ************ @ planet.nl>写道:

Kevin,

我尽量避免使用我的命名空间,它主要是为VB6开发人员创建的,
虽然已有很好的解决方案,在我看来,当你想要使用OOP时,我们会感到困惑。 (在某些情况下,我的命名空间具有方便的功能,所以不要理解我的错误。)

在你的父母中你可以使用mdichildren而不是那个openforms

http:// msdn2.microsoft.com/en-us/lib...ichildren.aspx

这个msdn页面让我感到困惑。它必须是me.mdichildren或者只是
mdichildren

MDI表单周围有更多属性,对于你来说很容易,你很忙,

我希望这会有所帮助,


" Kevin" <柯**** @ cfl.rr.com> schreef在bericht
新闻:2h ******************************** @ 4ax.com ..。< blockquote class =post_quotes>我的MDI父表单上有一个计时器。如果在设定的分钟数内没有鼠标移动,则所有打开表单的Visible属性将设置为False,并显示登录表单。我可以在VB6中完成。

在VB2005中,我可以获得所有打开表单的列表,但是在隐藏第一个表单后我收到错误。
这就是我正在尝试使用的:

对于每一个我在My.Application.OpenForms
如果m.Name<> " frmMain"然后
m.Visible = False
结束如果
下一个m

如果其中一个子表单显示 - 我的OpenForms集合正在改变。



你不能让孩子形成一个模态形式,它是不可能的...模态必须

有顶级访问权限,并且当时所有父母都失去了访问权限

(他们被锁定在获得焦点之外)当它是MDI窗口内MDI表单的一个孩子时,这是不可能的。

" Kevin" <柯**** @ cfl.rr.com>在消息中写道

news:7u ******************************** @ 4ax.com ...

我也试过了。唯一的问题是,我似乎无法以模态方式打开一个
MDIChild表单。我必须让他们以非子形式打开模态,所以他们不会在MDIChildren集合中结束。

2006年6月24日星期六07:16:02 +0200,Cor Ligthert [MVP]"
< no ************ @ planet.nl>写道:

Kevin,

我尽量避免使用我的命名空间,它主要是为VB6开发人员创建的,
虽然已有很好的解决方案,在我看来,当你想要使用OOP时,我们会感到困惑。 (在某些情况下,我的命名空间具有方便的功能,所以不要理解我的错误。)

在你的父母中你可以使用mdichildren而不是那个openforms

http:// msdn2.microsoft.com/en-us/lib...ichildren.aspx

这个msdn页面让我感到困惑。它必须是me.mdichildren或
只是
mdichildren

MDI表单周围有更多属性,对于你来说很容易,你很忙,

我希望这会有所帮助,


" Kevin" <柯**** @ cfl.rr.com> schreef在bericht
新闻:2h ******************************** @ 4ax.com。 ..

我的MDI父表单上有一个计时器。如果在设定的分钟数内没有鼠标移动,则所有打开表单的Visible属性将设置为False,并显示登录表单。我可以在VB6中完成。

在VB2005中,我可以获得所有打开表单的列表,但是在隐藏第一个表单后我收到错误。
这就是我正在尝试使用的:

对于每一个我在My.Application.OpenForms
如果m.Name<> " frmMain"然后
m.Visible = False
结束如果
下一个m

如果其中一个子表单显示



I''ve got a timer on my MDI parent form. If there''s no mouse movement
for a set number of minutes, the Visible property of all open forms is
set to False and the Log On form is displayed. I could do it in VB6.

In VB2005 I can get a list of all the open forms, but I get an error
after hiding the first one.

This is what I''m trying to use:

For Each m In My.Application.OpenForms
If m.Name <> "frmMain" Then
m.Visible = False
End If
Next m

It won''t list all the open forms if one of the child forms is showing
another modal form. And again, once it hides the first form, it bombs
out--something about my OpenForms collection changing.

解决方案

Kevin,

I try to avoid the my namespace, it is mainly created for VB6 developers,
while there were already good solutions, which are in my opinion less
confusing when you want to use OOP. (In some cases the my namespace has
handy features so don''t understand me wrong).

In your parent you can use the mdichildren instead of that openforms

http://msdn2.microsoft.com/en-us/lib...ichildren.aspx

This msdn page is in my idea confusing. It has to be me.mdichildren or just
mdichildren

There are more properties around the MDI form which are easy for you with
what you are busy,

I hope this helps,

Cor
"Kevin" <ke****@cfl.rr.com> schreef in bericht
news:2h********************************@4ax.com...

I''ve got a timer on my MDI parent form. If there''s no mouse movement
for a set number of minutes, the Visible property of all open forms is
set to False and the Log On form is displayed. I could do it in VB6.

In VB2005 I can get a list of all the open forms, but I get an error
after hiding the first one.

This is what I''m trying to use:

For Each m In My.Application.OpenForms
If m.Name <> "frmMain" Then
m.Visible = False
End If
Next m

It won''t list all the open forms if one of the child forms is showing
another modal form. And again, once it hides the first form, it bombs
out--something about my OpenForms collection changing.



I tried that too. The only problem is, I can''t seem to open a
MDIChild form modally. I have to make them non-child forms to open
them modally, so they don''t end up in the MDIChildren collection.
On Sat, 24 Jun 2006 07:16:02 +0200, "Cor Ligthert [MVP]"
<no************@planet.nl> wrote:

Kevin,

I try to avoid the my namespace, it is mainly created for VB6 developers,
while there were already good solutions, which are in my opinion less
confusing when you want to use OOP. (In some cases the my namespace has
handy features so don''t understand me wrong).

In your parent you can use the mdichildren instead of that openforms

http://msdn2.microsoft.com/en-us/lib...ichildren.aspx

This msdn page is in my idea confusing. It has to be me.mdichildren or just
mdichildren

There are more properties around the MDI form which are easy for you with
what you are busy,

I hope this helps,

Cor
"Kevin" <ke****@cfl.rr.com> schreef in bericht
news:2h********************************@4ax.com.. .

I''ve got a timer on my MDI parent form. If there''s no mouse movement
for a set number of minutes, the Visible property of all open forms is
set to False and the Log On form is displayed. I could do it in VB6.

In VB2005 I can get a list of all the open forms, but I get an error
after hiding the first one.

This is what I''m trying to use:

For Each m In My.Application.OpenForms
If m.Name <> "frmMain" Then
m.Visible = False
End If
Next m

It won''t list all the open forms if one of the child forms is showing
another modal form. And again, once it hides the first form, it bombs
out--something about my OpenForms collection changing.



you can''t make a child form a modal form, its impossible... modal has to
have top level access and all parents behind it lose access at that time
(they get locked out of gaining focus) this is impossible to do when it is a
child of a MDI form inside a MDI window..
"Kevin" <ke****@cfl.rr.com> wrote in message
news:7u********************************@4ax.com...

I tried that too. The only problem is, I can''t seem to open a
MDIChild form modally. I have to make them non-child forms to open
them modally, so they don''t end up in the MDIChildren collection.
On Sat, 24 Jun 2006 07:16:02 +0200, "Cor Ligthert [MVP]"
<no************@planet.nl> wrote:

Kevin,

I try to avoid the my namespace, it is mainly created for VB6 developers,
while there were already good solutions, which are in my opinion less
confusing when you want to use OOP. (In some cases the my namespace has
handy features so don''t understand me wrong).

In your parent you can use the mdichildren instead of that openforms

http://msdn2.microsoft.com/en-us/lib...ichildren.aspx

This msdn page is in my idea confusing. It has to be me.mdichildren or
just
mdichildren

There are more properties around the MDI form which are easy for you with
what you are busy,

I hope this helps,

Cor
"Kevin" <ke****@cfl.rr.com> schreef in bericht
news:2h********************************@4ax.com. ..

I''ve got a timer on my MDI parent form. If there''s no mouse movement
for a set number of minutes, the Visible property of all open forms is
set to False and the Log On form is displayed. I could do it in VB6.

In VB2005 I can get a list of all the open forms, but I get an error
after hiding the first one.

This is what I''m trying to use:

For Each m In My.Application.OpenForms
If m.Name <> "frmMain" Then
m.Visible = False
End If
Next m

It won''t list all the open forms if one of the child forms is showing
another modal form. And again, once it hides the first form, it bombs
out--something about my OpenForms collection changing.



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

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