부모 폼과 대화 상자가 있습니다. 나는 무엇을 여기에 대화부모로부터 대화 상대까지의 데이터
에 부모로부터 정보를 전달하는 데있어 필요
(어린이/대화) 형태로, 내가 intialitzed 한public partial class DlgGraphOptions : Form
{
public GraphOpts_t m_SerOpts = new GraphOpts_t();
}
private void InitSettings(int idxSeries)
{
m_nMaxPts = m_SerOpts.GetMaxPts(idxSeries);
}
그래서 내가 필요 DlgGraphOptions에서
private void Item_Click(object sender, EventArgs e)
{
DialogResult result = DialogResult.OK;
DlgGraphOptions _frmDlgGraphOptions = new DlgGraphOptions();
_frmDlgGraphOptions.m_SerOpts = theDGroup.m_SerOpts;
_frmDlgGraphOptions.ShowDialog(this);
if (result == DialogResult.OK)
{
// Save the revised options to the Data Group
theDGroup.m_SerOpts = _frmDlgGraphOptions.m_SerOpts;
}
부모로부터 대화 상자로 theDGroup.m_SerOpts를 전달하면 완료됩니다.
부모의 경우. 지금은 어린이 :
public GraphOpts_t m_SerOpts = new GraphOpts_t;
이것은 잘못된 것처럼 보입니다. 나는 그것을 다시 초기화하고 싶지 않다.
중복 : http://stackoverflow.com/questions/280579/how-do-i-pass- a-child-back-to-the-parent-form – Tremmors