Published on by

If you wrote an MFC dialog-based application using CMFCEditBrowseCtrl which worked properly until you updated to Visual Studio 2012 and now one of the controls is missing its browse button here is a workaround. Just add the line shown in bold to your code:

BOOL CYourAwesomeDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();
	...
	((CMFCEditBrowseCtrl*)GetDlgItem(IDC_YOUR_AWESOME_CONTROL))->EnableFileBrowseButton();
}

Replace IDC_YOUR_AWESOME_CONTROL with the ID of your problematic browse control which is not showing the button.

Alternatively, if you are using the control directly:

	CMFCEditBrowseCtrl m_YourAwesomeControl;
	...
	m_YourAwesomeControl.EnableFileBrowseButton();

Or if you have derived a class from it:

	CYourEditBrowseCtrl *m_YourAwesomeControl = new CYourEditBrowseCtrl;
	...
	m_YourAwesomeControl->EnableFileBrowseButton();