namespace WindowsFormsApp1
{
public partial class CPFind : Form
{
public static string IDF { get; set; }
public CPFind()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void button2_Click(object sender, EventArgs e)
{
IDF = IDText.Text;
DialogResult = DialogResult.OK ;
}
}
}
在主窗体我想调用,结果不行
CPFind cpfind = new CPFind();
不行是指编译错误还是窗口没出现?
我是想调用那个字符串,new出来的窗口无法调用,后来我发现直接用CPFind可以调用,问题就解决了,不过还是谢谢大佬!