清除所有变量,数组,公共共享和私有 [英] Clear all variables, Arrays, Public Shared and Private

查看:66
本文介绍了清除所有变量,数组,公共共享和私有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序会打开一个表单,允许用户选择其他可以打印标签的表单, 如果标签是打印的,那么他们选择的形式会关闭,而所有保持打开的形式都是原始形式。  然而,当他们
接下来选择一个表格并去打印一个标签时,它会打印并打印出来,即 而不是打印一个标签,它可以打印4. 我认为这是因为所有原始变量和索引仍在内存中。  当我更改代码以便
而不是关闭用户选择的表单结束时, 用户必须重新启动应用程序,但它应该打印,因此错误只发生在我关闭表单而原始表单打开时,而不是在我结束应用程序
并重新启动它时。 但每次启动应用程序都是一种真正的害虫。   我希望我在这里有意义。    

my program opens a form that allows the user to select a choice of other forms from which they can print a label,  when the label is print that form they have chosen closes and all that remains open is the original form.   However when they next select a form and go to print a label it prints and prints i.e.  instead of printing one label it could print 4.  I think this is because all the original variables and indexes are still in memory.   When I change the code so that instead of closing the form the user has chosen the application ends,  the user has to restart the application but it prints as it should so the error only happens when I close the form leaving the original form open and not when I end the application and restart it.  But it is a real pest to have to start up the application each time.    I hope that I am making sense here.    

无论如何关闭表单并清除所有变量,对象和数组都是公共共享和私有

Is there anyway of closing forms and clearing all variables, objects and arrays both Public Shared and Private

感谢您的帮助

推荐答案

创建表单的新实例

Create a new instance of the form

FormX formx = new FormX();

FormX formx = new FormX();

Dim frmx as New FormX

Dim frmx as New FormX


这篇关于清除所有变量,数组,公共共享和私有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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