必须删除面板内部@ Runtime的控件 [英] Have to delete the controls inside the panel @ Runtime

查看:84
本文介绍了必须删除面板内部@ Runtime的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须删除面板@ Runtime中的控件...
使用keydown事件表示当我按下键盘上的Delete键时,告诉我确切的代码...我该怎么做...

谢谢

i have to delete the controls inside the panel @ Runtime...
using keydown event Means when i press delete button of my keyboard tell me the exact code... how can i do that...

Thanks

推荐答案

尝试一下.

Try this.

private void removeControl(object sender, System.EventArgs e)
{
// NOTE: The code below uses the instance of
// the button (newPanelButton) from the previous example.
   if(panel1.Controls.Contains(newPanelButton))
   {
      this.newPanelButton.Click -= new System.EventHandler(this.
         NewPanelButton_Click);
      panel1.Controls.Remove(newPanelButton);
      newPanelButton.Dispose();
   }
}



这里供您参考:
http://msdn.microsoft.com/en-us/library/82785s1h%28v = vs.80%29.aspx [ ^ ]

问候,
爱德华(Eduard)



Here for your reference:
http://msdn.microsoft.com/en-us/library/82785s1h%28v=vs.80%29.aspx[^]

Regards,
Eduard


已解决已解决已解决已解决已解决已解决已解决已解决
SOLVED SOLVEDSOLVED SOLVEDSOLVED SOLVEDSOLVED SOLVEDSOLVED SOLVED


这篇关于必须删除面板内部@ Runtime的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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