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. abut Escape key and a dialog

abut Escape key and a dialog

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 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.
  • Z Offline
    Z Offline
    Zeeshan Bilal
    wrote on last edited by
    #1

    When i press an Escape Key ...during my application dialog is opend. it becomes dissapear. how can i handle this stupid way of escape key that on press it my dialog not dissappear. thanx

    V 1 Reply Last reply
    0
    • Z Zeeshan Bilal

      When i press an Escape Key ...during my application dialog is opend. it becomes dissapear. how can i handle this stupid way of escape key that on press it my dialog not dissappear. thanx

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

      Override OnOk and OnCancel functions (to do nothing or if you would like to handle them do not call CDialog::OnOk (OnCancel) in them). "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

      Z 1 Reply Last reply
      0
      • V V 0

        Override OnOk and OnCancel functions (to do nothing or if you would like to handle them do not call CDialog::OnOk (OnCancel) in them). "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

        Z Offline
        Z Offline
        Zeeshan Bilal
        wrote on last edited by
        #3

        i did it ,, but situation is same ,, dialog dissapears on Escape key. tellme the right way by example of code line thanx

        A V 2 Replies Last reply
        0
        • Z Zeeshan Bilal

          i did it ,, but situation is same ,, dialog dissapears on Escape key. tellme the right way by example of code line thanx

          A Offline
          A Offline
          Anonymous
          wrote on last edited by
          #4

          If CTestDialog is ur Dialog class, then add implementation void CTestDialog::OnCancel() { //Remember the function body has nothing } the problem was occuring because ur app must have had the implementation below: void CTestDialog::OnCancel() { CTrayDialog::OnCancel(); }

          1 Reply Last reply
          0
          • Z Zeeshan Bilal

            i did it ,, but situation is same ,, dialog dissapears on Escape key. tellme the right way by example of code line thanx

            V Offline
            V Offline
            V 0
            wrote on last edited by
            #5

            void yourclass::OnCancel(){ //do something but do not call CDialog::OnCancel(); } I once had the same problem and I solved it like this. (try both OnOK and OnCancel maybe) if this doesn't work I wouldn't know sorry. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

            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