A
Alex
Hello everybody,
I'm just starting C#. I'm working on forms based application. The
parent form has some buttons. If I click the button, some child form
must pop-up. My question is - is there in C# something analogous to
OnInitDialog from C++? So I'm able to initialize controls in the
child form based on the info from the parent?
I have:
private void btSomeButton_Click(object sender, EventArgs e)
{
SomeChildDlg dlg = new SomeChildDlg();
dlg.m_strValueForControl1 = "aaaaaa";
dlg.m_strValueForControl2 = "xxxxxx";
if (dlg.ShowDialog() == DialogResult.OK)
.......................................................
...............................
But how at the very beginning can I populate controls in my
SomeChildDlg form (put string "aaaaaa" in one text box on child form
and assing "xxxxxx" to another text box) ? Do I have to call
someother function in between constructor and dlg.ShowDialog()?
Thanks,
Alex
I'm just starting C#. I'm working on forms based application. The
parent form has some buttons. If I click the button, some child form
must pop-up. My question is - is there in C# something analogous to
OnInitDialog from C++? So I'm able to initialize controls in the
child form based on the info from the parent?
I have:
private void btSomeButton_Click(object sender, EventArgs e)
{
SomeChildDlg dlg = new SomeChildDlg();
dlg.m_strValueForControl1 = "aaaaaa";
dlg.m_strValueForControl2 = "xxxxxx";
if (dlg.ShowDialog() == DialogResult.OK)
.......................................................
...............................
But how at the very beginning can I populate controls in my
SomeChildDlg form (put string "aaaaaa" in one text box on child form
and assing "xxxxxx" to another text box) ? Do I have to call
someother function in between constructor and dlg.ShowDialog()?
Thanks,
Alex