如何防止射击“离开”开放形式的活动? [英] How to prevent firing "Leave" event on open form??

查看:63
本文介绍了如何防止射击“离开”开放形式的活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道这是否是VB.NET 2002中的一个错误,以及如何克服那个

的情况?


我有一个MDI表单,我打电话给我MDI儿童形式如下:


Dim frm As new frmChild()

frm.MdiParent = Me

frm.Show( )


在那个子表单上我有一些文本框。当表格显示离开事件

立即在第一个文本框中触发,但这不应该发生在我的

意见中。


有趣这是在VS 2003中没有发生的。另一个观察结果

如果我打开那个表格作为非MDI孩子,那就不会发生这种情况

(没有& ; frm.MdiParent =我声明。


任何帮助或想法如何防止这种情况将非常感激。

问候,

比利

Anyone know if this a bug in VB.NET 2002 and how to overcame that
situation?

I have a MDI form from where I call MDI child form like that:

Dim frm As New frmChild()
frm.MdiParent = Me
frm.Show()

On that child form I have some textboxes. When form show up Leave event
immediately fire in 1st textbox, but that should NOT happen in my
opinion.

Interesting is that this doesn''t happen in VS 2003. Another observation
is that this doesn''t happen if I open that form as non MDI child
(without "frm.MdiParent = Me" statement).

Any help or ideas how to prevent this will be very appreciated.
Regards,
Billy

推荐答案

比利,


这是你第二次问这个问题和完全相同的

文本。


这是一个非常活跃的新闻组,所以如果有人知道答案你将会是

已经回答了,当它保持开放的某些日子我们赞赏的清洁版彼得

黄将主要再次搜索答案。


当你想要更快回答,比你可以去微软支持符合

存在的规则。


另一种方法可以用另一种方式解释你的问题,实例

码。如何创建你的MIDI孩子以及什么可能是特别的

你的文本框。


只是我的想法,


Cor


" Billy" < ab **** @ yahoo.com>
Billy,

This is the second time you ask this question and with the exact the same
text.

This is a very active newsgroup, so if somebody knows the answer you will be
answered and when it stays open some days our appreciated cleansweaper Peter
Huang will mostly search again for an answer.

When you want a quicker answer, than you can go to Microsoft support conform
the rules which exist for that.

Another approach can be to explain your problem in another way, by instance
with some code. How you create your MIDI child and what is maybe special on
your textbox.

Just my thought,

Cor

"Billy" <ab****@yahoo.com>
任何人都知道这是VB.NET 2002中的一个错误,以及如何克服这种情况?

我有一个MDI表单,我称之为MDI子表格:

Dim frm As new frmChild()
frm.MdiParent = Me
frm.Show ()

在那个子表单上我有一些文本框。当表单显示时,事件会立即在第一个文本框中触发,但这不应该在我的意见中发生。

有趣的是,这在VS 2003中不会发生。另一个观察结果是,如果我将该表格作为非MDI儿童打开(没有frm.MdiParent = Me声明),就不会发生这种情况。

任何帮助或者想法如何防止这种情况将非常感激。
问候,比利
Anyone know if this a bug in VB.NET 2002 and how to overcame that
situation?

I have a MDI form from where I call MDI child form like that:

Dim frm As New frmChild()
frm.MdiParent = Me
frm.Show()

On that child form I have some textboxes. When form show up Leave event
immediately fire in 1st textbox, but that should NOT happen in my
opinion.

Interesting is that this doesn''t happen in VS 2003. Another observation
is that this doesn''t happen if I open that form as non MDI child
(without "frm.MdiParent = Me" statement).

Any help or ideas how to prevent this will be very appreciated.
Regards,
Billy



我不知道如何解释那更容易。如果你创建一个新项目,

将主窗体设置为MDI容器,并从那里调用子窗体,如我在我的第一篇文章中写的
,你只需检查是否离开当您打开该子表单时,事件会在
第一个文本框中触发。也许只是在我的

PC上出现问题?

I don''t know how to explain that easier. If you create a new project,
set main form as MDI container and from there call child form like I
wrote in my first post, you just have to check if leave event fires in
1st textbox when you open that child form. Maybe is problem just on my
PC?


Billy,


你自己做一个* new *项目的测试,当不试试并告诉

我的结果?

\\\ form1

Private Sub Form1_Load(ByVal sender As Object,_

ByVal e As System.EventArgs)Handles MyBase.Load

Me.IsMdiContainer = True

Dim frm As New Form2

frm.MdiParent = Me

frm.Show()

End Sub

///

\\\form2

Private Sub TextBox1_Leave(ByVal sender As Object,_

ByVal e As System .EventArgs)处理TextBox1.Leave

MessageBox.Show(你好我已经离开)

结束子

///

我希望这有帮助吗?


Cor
Billy,

Did you do this test yourself with a *new* project, when not try it and tell
me the result?
\\\form1
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.IsMdiContainer = True
Dim frm As New Form2
frm.MdiParent = Me
frm.Show()
End Sub
///
\\\form2
Private Sub TextBox1_Leave(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles TextBox1.Leave
MessageBox.Show("Hello I am leaved")
End Sub
///
I hope this helps?

Cor
我不知道如何解释这一点更容易。如果你创建一个新项目,
将主窗体设置为MDI容器,并从那里调用子窗体,如我在第一篇文章中写的,你只需要检查是否在事件中发生事件。
1st打开该子表单时的文本框。也许只是在我的
PC上出现问题?
I don''t know how to explain that easier. If you create a new project,
set main form as MDI container and from there call child form like I
wrote in my first post, you just have to check if leave event fires in
1st textbox when you open that child form. Maybe is problem just on my
PC?



这篇关于如何防止射击“离开”开放形式的活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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