Example:
public partial class abc1 : Form
{
public string str__subgrp { get; set; }
public string str__type { get; set; }
public string return_str__type { get; set;
public abc1()
{
InitializeComponent();
}
private void savebtn_click(object sender, EventArge e )
{
this.str__subgrp = "ABC";
this.str__type = "123";
this.return_str__type = "This word is unicode";
}
}
public partial class worknow : Form
{
// ... declare variable in class ....
public worknow()
{
InitializeComponent();
}
private void showformbtn_click(object sender, EventArge e )
{
string a,b,c;
using ( var abc1_frm = new abc1())
{
abc1_frm.ShowDialog();
a = abc1_frm.str__subgrp;
b = abc1_frm.str__type;
c = abc1_frm.return_str__type; // This variable = null
}
}
}
In the comment line (this variable = null)
return_str__type
変数が値を返すのはなぜnull
ですか?