麻烦帮忙修改C#非模态窗口,使之能用lsp实时修改及获取窗口值
本帖最后由 tender138 于 2024-11-7 06:42 编辑麻烦帮忙修改C#窗体
public class Class1
{
private static FormMain MyForm = null;//此处是关键
static public void LoadWin()
{
if (MyForm == null) { MyForm = new FormMain(); }
MyForm.Show();
MyForm.TextBox1.Text = "001";
MyForm.TextBox2.Text = "002";
}
public static ResultBuffer GetVal(ResultBuffer resBufIn)
{
if (MyForm == null)
{
return new ResultBuffer(new TypedValue((int)LispDataType.Nil));
}
else
{
return new ResultBuffer(new TypedValue((int)LispDataType.Int32, MyForm.TextBox1.Text));
}
}
public static ResultBuffer CloseMyForm(ResultBuffer resBufIn)
{
if (MyForm != null)
{
MyForm.Close();
}
return new ResultBuffer(new TypedValue((int)LispDataType.T_atom, true));
}
} guohq 发表于 2024-11-3 22:22
非常感谢!困扰多时的问题解决了!
页:
[1]