I have a parent form containing "HUD" with first name, last name, etc. One of the child forms is the search form. When the user selects an item from the results displayed in the DataGrid, I want the relevant information to populate the HUD. I created a HUD class with variables for each value and the UpdateHUD () method. I am not sure how to do this. I have a link to a parent form search form containing a HUD, for example:
public frmWWCModuleHost _frmWWCModuleHost;
This is the code I use to embed forms. I do not use MDI.
public static void ShowFormInContainerControl(Control ctl, Form frm)
{
frm.TopLevel = false;
frm.FormBorderStyle = FormBorderStyle.None;
frm.Dock = DockStyle.Fill;
frm.Visible = true;
ctl.Controls.Add(frm);
}
Here is the code that I run on the cell. Click on the search form. This happens before I tried to implement the HUD class.
private void dgvSearchResults_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
_frmWWCModuleHost = new frmWWCModuleHost();
_frmWWCModuleHost.tbxHUD_LastName.Text = dgvSearchResults.CurrentRow.Cells[1].FormattedValue.ToString();
_frmWWCModuleHost.tbxHUD_LastName.Invalidate();
_frmWWCModuleHost.FormPaint();
}
Thanks in advance!
~ Patrick
EDIT
dgvSearchResults_CellContentClick . , , HUD.
EDIT 2
, NEW frmWWCModuleHost ? .
3
"" , : , , . _frmWWCModuleHost = m_parent; UpdateHUD() , _CellClick .
, ; - , ?