对象=什么都没有但仍然存在??? [英] Object = nothing but still exists???

查看:64
本文介绍了对象=什么都没有但仍然存在???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含数据网格的windows类form2。在Cor的帮助下,我使用这种策略来更好地管理记忆。


在表格一中我有:


dim Matrix_A as form2


Private Sub populateA()

Dim Matrix_A As new form2

填充网格的方法和显示形式

end sub


后来,在第一次执行populateA之后我希望能够隐藏显示的

使用新信息表单并重新执行populateA。然而,在执行完第一次populateA完成后,完成Matrix_A就没有了。


因为它什么都没有,我怎么能让它消失所以我不会有两个

(令人困惑)显示Matrix_A表格?并且,如果它什么都没有,我怎么能

浏览它的数据网格?


-

mark b

I have a windows class form2 that contains a datagrid. With Cor''s help I am
using this strategy to better manage memory.

In form one I have:

dim Matrix_A as form2

Private Sub populateA()
Dim Matrix_A As New form2
Method to fill grid and display form
end sub

Later, after the first execution of populateA I want to be able to hide the
shown form and reexecute populateA with new information. However, after
executing the first populateA completes Matrix_A is nothing.

Since it is nothing, how can I make it dissappear so I won''t have two
(confusing) Matrix_A forms displayed? And, if it is nothing, how come I can
browse its datagrid?

--
mark b

推荐答案

mark写道:
我有一个包含数据网格的windows类form2。在Cor的帮助下,我使用这种策略来更好地管理记忆。

在表格一中我有:

暗淡的Matrix_A作为形式2

Private Sub populateA()
Dim Matrix_A As new form2
填充网格和显示形式的方法
结束后

后来,第一次执行后populateA我希望能够隐藏
显示的表单并使用新信息重新执行populateA。然而,在执行完第一个populateA之后,完成Matrix_A就没什么了。

因为它什么都没有,我怎么能让它消失所以我不会有两个
(令人困惑) Matrix_A表格显示?并且,如果它什么都没有,我怎么能浏览它的数据网格?
I have a windows class form2 that contains a datagrid. With Cor''s help I am
using this strategy to better manage memory.

In form one I have:

dim Matrix_A as form2

Private Sub populateA()
Dim Matrix_A As New form2
Method to fill grid and display form
end sub

Later, after the first execution of populateA I want to be able to hide the
shown form and reexecute populateA with new information. However, after
executing the first populateA completes Matrix_A is nothing.

Since it is nothing, how can I make it dissappear so I won''t have two
(confusing) Matrix_A forms displayed? And, if it is nothing, how come I can
browse its datagrid?




这是糟糕的编程。你两次声明Matrix_A变量。


我想你想做的事:


暗淡的Matrix_A as form2

Private Sub populateA()

Matrix_A =新表格2

Matrix_A.showdialog

填写网格和显示表格的方法

end sub



This is bad programming. You are declaring Matrix_A variable twice.

I think you wanted to do:

dim Matrix_A as form2
Private Sub populateA()
Matrix_A = New form2
Matrix_A.showdialog
Method to fill grid and display form
end sub


你的方法更好,但我仍然得到Matrix_A的多个可见副本如果

我多次执行populateA ..我知道我正在被愚蠢但是我不知道当一个新的Matrix_A到来时(除了点击关闭控制之外)还有新的Matrix_A来关闭原始文件。

-

mark b

我不喜欢垃圾邮件写道:
Your method is better, But I still get multiple visible copies of Matrix_A if
I execute populateA multiple times.. I know I am being dunderheaded but I
just can''t figure out how to close the originals when a new Matrix_A comes
into existance (other than clicking the close control).
--
mark b
"I Don''t Like Spam" wrote:
mark写道:
我有一个包含数据网格的windows类form2。在Cor的帮助下,我使用这种策略来更好地管理记忆。

在表格一中我有:

暗淡的Matrix_A作为形式2

Private Sub populateA()
Dim Matrix_A As new form2
填充网格和显示形式的方法
结束后

后来,第一次执行后populateA我希望能够隐藏
显示的表单并使用新信息重新执行populateA。然而,在执行完第一个populateA之后,完成Matrix_A就没什么了。

因为它什么都没有,我怎么能让它消失所以我不会有两个
(令人困惑) Matrix_A表格显示?并且,如果它什么都没有,我怎么能浏览它的数据网格?
I have a windows class form2 that contains a datagrid. With Cor''s help I am
using this strategy to better manage memory.

In form one I have:

dim Matrix_A as form2

Private Sub populateA()
Dim Matrix_A As New form2
Method to fill grid and display form
end sub

Later, after the first execution of populateA I want to be able to hide the
shown form and reexecute populateA with new information. However, after
executing the first populateA completes Matrix_A is nothing.

Since it is nothing, how can I make it dissappear so I won''t have two
(confusing) Matrix_A forms displayed? And, if it is nothing, how come I can
browse its datagrid?



这是糟糕的编程。你两次声明Matrix_A变量。

我想你想做:

将Matrix_A变为form2
Private Sub populateA()
Matrix_A = New form2
Matrix_A.showdialog
填充网格和显示形式的方法
end sub



This is bad programming. You are declaring Matrix_A variable twice.

I think you wanted to do:

dim Matrix_A as form2
Private Sub populateA()
Matrix_A = New form2
Matrix_A.showdialog
Method to fill grid and display form
end sub



mark写道:
你的方法更好,但是如果我多次执行populateA,我仍然可以得到Matrix_A的多个可见副本。我知道我正在被愚弄但我还是想不通如何在新的Matrix_A存在时关闭原件(除了单击关闭控件之外)。
Your method is better, But I still get multiple visible copies of Matrix_A if
I execute populateA multiple times.. I know I am being dunderheaded but I
just can''t figure out how to close the originals when a new Matrix_A comes
into existance (other than clicking the close control).




您如何知道如何关闭Matrix_A?什么假设触发

收盘呢?您可能正在寻找:

dim Matrix_A作为新表格2

Private Sub populateA()

Matrix_A.Show

做一堆东西

Matrix_A.Close

end sub



How do you know how to close Matrix_A? What is suppose to trigger
closing it? You may be looking for:
dim Matrix_A as new form2
Private Sub populateA()
Matrix_A.Show
Do a bunch of stuff
Matrix_A.Close
end sub


这篇关于对象=什么都没有但仍然存在???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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