Resize, relocate and make an initially invisible edit control visible

I am writing an MFC dialog application with a static control and an edit control (which is initially set to be invisible) on it. The static has regions (for example, A01, A02, A03, A04, B01, B02, ...) at runtime like this: enter image description here

When I double-click mouse inside some particular rectangle of the static (A02, for example), I want the edit control resize to the size of the rectangle and cover that rectangle (A02, for example) like this: enter image description here

However, this is not until I input something (for example, the character 'a') and delete them. That is, when I double-click A02, the caret of the edit control appears but I still can see the "A02" caption of the rectangle: enter image description here

Below is how I make the edit control visible and change its position (rtEdit is the CRect object corresponding to A02 in this case, and m_rtPanelParent is the CRect object corresponding to the whole static. I get m_rtPanelParent by m_stcPanel.GetWindowRect (&m_rtPanelParent); and ScreenToClient (&m_rtPanelParent); in my dialog's OnInitDialog()):

void CStaticPanel::OnLButtonDblClk(UINT nFlags, CPoint point)
    m_pDlgParent->m_editCaption.SetWindowPos (&wndTop, m_pDlgParent->m_rtPanelParent.left + rtEdit.left, m_pDlgParent-> +, rtEdit.Width (), rtEdit.Height (), SWP_SHOWWINDOW);
    m_pDlgParent->m_editCaption.SetFocus ();

    CStatic::OnLButtonDblClk(nFlags, point);

I think the edit control has correct size and position of the rectangle (which I double-clicked in). See below:

enter image description here

I would appreciate any help with this situation.