好的,我正在尝试从两个不同的父母那里打开一份表格,但我不知道如何让它发挥作用。我尝试对 AdminStartMenu 和 TeacherStartMenu 使用布尔值,如果从一个打开,一个为真,另一个从另一个打开,则为假,但这似乎不起作用。
如何让一个孩子为两个不同的父母工作?
谢谢!
public partial class EditUser : Form
{
AdminStartMenu pf;
TeacherStartMenu tp;
public bool first = true;
public int st = 0;
public bool Editting;
public bool Adding;
public bool Viewing;
public bool AdminParent;
public bool TeacherParent;
public EditUser()
{
InitializeComponent();
}
public EditUser(AdminStartMenu Parent)
{
pf = Parent;
InitializeComponent();
EditFunction();
if (pf.Adding == true)
{
BlankForm();
SaveButton.Text = "Save";
}
if (pf.Editting == true)
{
FillFormVariables();
SaveButton.Text = "Save";
}
}
public EditUser(TeacherStartMenu TParent)
{
tp = TParent;
InitializeComponent();
EditFunction();
if (tp.Adding == true)
{
BlankForm();
SaveButton.Text = "Save";
}
if (tp.Editting == true)
{
FillFormVariables();
SaveButton.Text = "Save";
}
}