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. how to ask a yes or no question

how to ask a yes or no question

Scheduled Pinned Locked Moved C / C++ / MFC
c++delphitutorialquestion
5 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.
  • V Offline
    V Offline
    V_shr
    wrote on last edited by
    #1

    Hello I need to ask a Yes or No question in a message box . like Application->MessageBoxA() but with two buttons : Yes and No I am working with Borland C++Builder. thanks

    C C S 3 Replies Last reply
    0
    • V V_shr

      Hello I need to ask a Yes or No question in a message box . like Application->MessageBoxA() but with two buttons : Yes and No I am working with Borland C++Builder. thanks

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      Specify MB_YESNO for uType parameter of the MessageBox function. More info here[^]


      Cédric Moonen Software developer
      Charting control [Updated - v1.1]

      V 1 Reply Last reply
      0
      • C Cedric Moonen

        Specify MB_YESNO for uType parameter of the MessageBox function. More info here[^]


        Cédric Moonen Software developer
        Charting control [Updated - v1.1]

        V Offline
        V Offline
        V_shr
        wrote on last edited by
        #3

        Thanks

        1 Reply Last reply
        0
        • V V_shr

          Hello I need to ask a Yes or No question in a message box . like Application->MessageBoxA() but with two buttons : Yes and No I am working with Borland C++Builder. thanks

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

          If you search for MessageBox on the msdn.microsoft.com website you will see that it takes four input parameters like this: MessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType); HWND is the window handle lpText is the text that is going to ask the question lpCaption is the title of the message box uType is the type of box (for a yes/no box set it to MB_YESNO in visual studio) make sure you include the required header file Windows.h for the defines

          Chipper Martin

          1 Reply Last reply
          0
          • V V_shr

            Hello I need to ask a Yes or No question in a message box . like Application->MessageBoxA() but with two buttons : Yes and No I am working with Borland C++Builder. thanks

            S Offline
            S Offline
            sheshidar
            wrote on last edited by
            #5

            if(AfxMessageBox (_T("Question"),MB_YESNO)==IDYES) { //do if answer is yes } else { //do if answer is no }

            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