Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Browse Button in an Dialog Box

Browse Button in an Dialog Box

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    ppathan
    wrote on last edited by
    #1

    If I want to add an browse functionality in my dialog box, how can we do that??

    V H C 3 Replies Last reply
    0
    • P ppathan

      If I want to add an browse functionality in my dialog box, how can we do that??

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      What is a browse functionality? Kuphryn

      1 Reply Last reply
      0
      • P ppathan

        If I want to add an browse functionality in my dialog box, how can we do that??

        H Offline
        H Offline
        HPSI
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • P ppathan

          If I want to add an browse functionality in my dialog box, how can we do that??

          C Offline
          C Offline
          calebcohoon
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups