从表单中删除控件 [英] Removing controls from a form

查看:142
本文介绍了从表单中删除控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚意识到,如果我从表单(例如标签,文本框等)中删除控件,则不会自动清除vb添加到form designer.vb文件中的补充行.

但是我一直在读,您可以自行清理vb.net,但是我读过的所有内容都让我感到困惑,这与这段代码有关

I have just realised that if I delete a control from a form (ie label, textbox etc) the supplimentry lines that vb adds to the form designer.vb file are not cleaned out automatically.

But I have been reading that you can get vb.net to clean up after itself, but all I have read leaves me rather confused and it has sometrhing to do with this code

'Form overrides dispose to clean up the component list.
 <System.Diagnostics.DebuggerNonUserCode()> _
 Protected Overrides Sub Dispose(ByVal disposing As Boolean)
     Try
         If disposing AndAlso components IsNot Nothing Then
             components.Dispose()
         End If
     Finally
         MyBase.Dispose(disposing)
     End Try



我可以在VB中拨打电话吗?



Do I put a call somewhere in the VB?

Do I call it somehow off-line?

推荐答案

您要说的是通过删除其中已添加的多余代码行来清理文件. AFAIK,编译代码时,编译器应忽略这些多余的行.

他们在谈论的是清理物理内存对象.
What you are talking about is cleaning your file by removing extra lines of code that have been added in there. AFAIK, the compiler should be ignoring these extra line when your code is compiled.

What they are talking about is about cleaning up the physical memory objects.


这篇关于从表单中删除控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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