如何以另一种形式访问控件(按钮)[C#]

时间:2018-04-25 21:16:03

标签: c#

我希望从另一种形式,我有按钮列表及其属性(来自另一种形式的button1.text)。

{
public partial class Form2 : Form
{
    public Form2()
    {   
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
         button2.text = " "; //this is the button that should appear to me, which is part of the other form.
    }

}

问题是相对属性和按钮本身不会出现在我身上。即使我这样做:

Form1 Home = New Form1();

0 个答案:

没有答案