本文介绍了如何在运行时删除动态按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用c#中的visual studio在运行时使用以下代码创建了动态按钮。现在我想删除我在运行时创建的一些按钮。我可以这样做吗



我尝试了什么:



按钮dynamicButton = new Button();

dynamicButton.Location = new Point(300 + tx4,200 + tx3);

dynamicButton.Height = nh;

dynamicButton.Width = nw;

dynamicButton.BackColor = Color.Gray;

dynamicButton.ForeColor = Color.Blue;

dynamicButton.Click + = new EventHandler(DynamicButton_Click);

Controls.Add(dynamicButton);

i created dynamic buttons using following code in run times using visual studio in c#. now i want to deleting some buttons that i created in run time.how can i do that

What I have tried:

Button dynamicButton = new Button();
dynamicButton.Location = new Point(300 + tx4, 200 + tx3);
dynamicButton.Height = nh;
dynamicButton.Width = nw;
dynamicButton.BackColor = Color.Gray;
dynamicButton.ForeColor = Color.Blue;
dynamicButton.Click += new EventHandler(DynamicButton_Click);
Controls.Add(dynamicButton);

推荐答案



这篇关于如何在运行时删除动态按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 04:20