Browse Button in an Dialog Box
C / C++ / MFC
4
Posts
4
Posters
0
Views
1
Watching
-
The usual way is to add a button with three dots (or the word "Browse"). Add a ON_BN_CLICKED message handler for the button, and within the handler call SHBrowseForFolder or CFileDialog. Search CP for examples of both. HPS HwndSpy - GUI developer's aid to visually locate and inspect windows. For the month of August only, use coupon code CP-81239 for 30% off.
-
Hello! In your dialog box, have a button where the user clicks and have that button execute this code: void your_class_name_here::OnButtonClick() { CFileDialog m_file(TRUE); CString m_value; if(m_file.DoModal() == IDOK) { // get file selected m_value = m_file.GetFileName(); UpdateData(FALSE); } // add whatever else you need } Hope that helps! :) Caleb