GetWindowRect()で情報を得る
void ChangeEdit2Height(){
// 文字列の取得
CString strBuff;
int nstrLen = ce2.GetWindowTextLength() + 2;
ce2.GetWindowText(strBuff.GetBuffer(nstrLen), nstrLen);
strBuff.ReleaseBuffer();
// IDC_Edit2のサイズ変更
CDCHandle cdcE2(ce2.GetDC()); // デストラクタでリリースされない
cdcE2.SelectFont(ce2.GetFont()); // フォントをコントロールに会わせる
CRect rc2W, rc2R; // ウィンドウRectと、フォーマット領域Rect
ce2.GetWindowRect(&rc2W); this->ScreenToClient(&rc2W);
ce2.GetRect(&rc2R);
rc2W.bottom += -rc2R.Height() + cdcE2.DrawText(strBuff, -1, &rc2R, DT_EDITCONTROL | DT_WORDBREAK | DT_NOPREFIX | DT_CALCRECT);
if(rc2R.Height() != 0) ce2.MoveWindow(&rc2W); // 0pxで更新すると、rc2Rの高さがあるのでおかしくなる
ce2.ReleaseDC(cdcE2);
return;
}