在窗口上显示了个button,怎样将他销毁? 试试这个:[DllImport("user32.dll", EntryPoint="DestroyWindow")]public static extern int DestroyWindow ( int hwnd); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Remove后,buttonx是不是销毁了?我能再次调用创建buttonx的代码吗? this.buttonx = new System.Windows.Forms.Button(); this.buttonx.Location = new System.Drawing.Point(150, 40); this.buttonx.Name = "buttonx"; this.buttonx.TabIndex = 1; this.buttonx.Text = "buttonx"; this.Controls.Add(this.buttonx); REMOVE好像没有销毁,我测试过,要不用DESPOSE吧来干掉他 我能再次调用创建buttonx的代码吗?当然可以! 为什么一定要销毁呢?visible= false不就可以了? 我要释放资源close和dispose区别是什么? 为什么要释放资源.net提倡自动的垃圾收集 你让这个button不被任何对象引用,垃圾回收机制会帮你dispose它的 VC6向C#写的程序发消息,参数收不到 IIS发布网站有错误 winform combox高级运用问题 C#概念问题 !!!请教大侠!动态创建类 面试题 C#中,请问如何将当前的时间入到Access数据库中? .net4.0中,wcf的数据契约上可以不用写DataContract和DataMember标签了么? window API的问题 哪里有DUWAMISH7.0下载 求一正则表达式将SQL语句中的ORDER BY子句去掉 水晶报表子报表嵌套问题
this.buttonx = new System.Windows.Forms.Button();
this.buttonx.Location = new System.Drawing.Point(150, 40);
this.buttonx.Name = "buttonx";
this.buttonx.TabIndex = 1;
this.buttonx.Text = "buttonx";
this.Controls.Add(this.buttonx);
当然可以!
close和dispose区别是什么?
.net提倡自动的垃圾收集