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. changing defaut button

changing defaut button

Scheduled Pinned Locked Moved C / C++ / MFC
questionwpf
10 Posts 5 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.
  • T Offline
    T Offline
    toxcct
    wrote on last edited by
    #1

    hi everybody, how can i, in a dialog dox application, change the default button ? i've tried to change the styles (SetStyle() or something like that) of the buttons, but it only changes the STYLE, and not the effective function of DEFAULT BUTTON. any ideas guys ? thx a lot


    TOXCCT >>> GEII power

    B B Y B 4 Replies Last reply
    0
    • T toxcct

      hi everybody, how can i, in a dialog dox application, change the default button ? i've tried to change the styles (SetStyle() or something like that) of the buttons, but it only changes the STYLE, and not the effective function of DEFAULT BUTTON. any ideas guys ? thx a lot


      TOXCCT >>> GEII power

      B Offline
      B Offline
      basementman
      wrote on last edited by
      #2

      From MSDN: An application sends a DM_SETDEFID message to change the identifier of the default push button for a dialog box. DM_SETDEFID wParam = idControl; // identifier of new default push button  onwards and upwards...

      1 Reply Last reply
      0
      • T toxcct

        hi everybody, how can i, in a dialog dox application, change the default button ? i've tried to change the styles (SetStyle() or something like that) of the buttons, but it only changes the STYLE, and not the effective function of DEFAULT BUTTON. any ideas guys ? thx a lot


        TOXCCT >>> GEII power

        B Offline
        B Offline
        BlackDice
        wrote on last edited by
        #3

        It's already a method of the CDialog class: CDialog::SetDefID() this->SetDefID(IDC_BUTTON1); works just fine. :) If I write code in my sleep, does that make me brilliant, or just a lazy programmer? My articles www.stillwaterexpress.com BlackDice - the programmer formerly known as bdiamond

        1 Reply Last reply
        0
        • T toxcct

          hi everybody, how can i, in a dialog dox application, change the default button ? i've tried to change the styles (SetStyle() or something like that) of the buttons, but it only changes the STYLE, and not the effective function of DEFAULT BUTTON. any ideas guys ? thx a lot


          TOXCCT >>> GEII power

          Y Offline
          Y Offline
          Yulianto
          wrote on last edited by
          #4

          Default button? Check the button properties.


          Work hard and a bit of luck is the key to success.

          You don`t need to be genius, to be rich.

          T 1 Reply Last reply
          0
          • T toxcct

            hi everybody, how can i, in a dialog dox application, change the default button ? i've tried to change the styles (SetStyle() or something like that) of the buttons, but it only changes the STYLE, and not the effective function of DEFAULT BUTTON. any ideas guys ? thx a lot


            TOXCCT >>> GEII power

            B Offline
            B Offline
            bmzhao
            wrote on last edited by
            #5

            Use resource eidt ,set the button default.

            T 1 Reply Last reply
            0
            • Y Yulianto

              Default button? Check the button properties.


              Work hard and a bit of luck is the key to success.

              You don`t need to be genius, to be rich.

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              no, if you did have a look at what i said previously, i've already done this, and, it doesn't change nothing else but the style of the buttons, not the effective default action...


              TOXCCT >>> GEII power

              Y 2 Replies Last reply
              0
              • B bmzhao

                Use resource eidt ,set the button default.

                T Offline
                T Offline
                toxcct
                wrote on last edited by
                #7

                ok, and when i want to change the default property when the program is running, what do i do ? :confused::~ :omg::wtf::suss:


                TOXCCT >>> GEII power

                1 Reply Last reply
                0
                • T toxcct

                  no, if you did have a look at what i said previously, i've already done this, and, it doesn't change nothing else but the style of the buttons, not the effective default action...


                  TOXCCT >>> GEII power

                  Y Offline
                  Y Offline
                  Yulianto
                  wrote on last edited by
                  #8

                  Oh you did. Try not to use any style on that button. This might be a bug.


                  Work hard and a bit of luck is the key to success.

                  You don`t need to be genius, to be rich.

                  1 Reply Last reply
                  0
                  • T toxcct

                    no, if you did have a look at what i said previously, i've already done this, and, it doesn't change nothing else but the style of the buttons, not the effective default action...


                    TOXCCT >>> GEII power

                    Y Offline
                    Y Offline
                    Yulianto
                    wrote on last edited by
                    #9

                    Maybe you delete the IDOK button, and it is the default button. Start over again, and change the IDOK button as your default button. Got the idea?


                    Work hard and a bit of luck is the key to success.

                    You don`t need to be genius, to be rich.

                    T 1 Reply Last reply
                    0
                    • Y Yulianto

                      Maybe you delete the IDOK button, and it is the default button. Start over again, and change the IDOK button as your default button. Got the idea?


                      Work hard and a bit of luck is the key to success.

                      You don`t need to be genius, to be rich.

                      T Offline
                      T Offline
                      toxcct
                      wrote on last edited by
                      #10

                      sorry but... you're fully wrong ! i need to change the default button programmatically because the default button will change in time depending on several events... you've got it now ?


                      TOXCCT >>> GEII power

                      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