1. 程式人生 > >怎麼拖動文字框 -- MFC

怎麼拖動文字框 -- MFC

1,新增訊息OnLButtonDown

2,新增程式碼

	CRect rect;
	GetClientRect(&rect);

	rect.bottom = rectCaption.top + 5;
	if (rect.PtInRect(point)) {
		::SendMessage(GetSafeHwnd(), WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
	}
	CDialog::OnLButtonDown(nFlags, point);