从类中检索字符串到我的表单

时间:2017-02-13 15:18:06

标签: c# winforms

我想在我班级的字符串中给出一个值。然后我想在我的表格中使用它。

示例类:

public class BMI
{
  public string val = "test";
}

表单示例:

private void button1_Click(object sender, EventArgs e)
{          
  BMI ss= new BMI();
  ss.val = textBox1.Text;
}

不幸的是我的textxbox为null。我需要充满价值"测试"来自我的班级

1 个答案:

答案 0 :(得分:0)

你的方法错了:

android:layout_alignBottom