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. SetRange for CSpinButtonCtrl

SetRange for CSpinButtonCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
c++design
7 Posts 2 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.
  • J Offline
    J Offline
    Jerry Wang 0
    wrote on last edited by
    #1

    Hi, I am a new to C++ MFC design so thanks in advance for the inputs. I am wondering if anyone can tell me where is the best place to put the SetRange(int, int) command for a spinner inside a modeless propertyPage. I understand the usual place is in OnInitDlg. However, I don't think there is a similar OnInit function for my property page/sheet. Thanks! ;)

    T 1 Reply Last reply
    0
    • J Jerry Wang 0

      Hi, I am a new to C++ MFC design so thanks in advance for the inputs. I am wondering if anyone can tell me where is the best place to put the SetRange(int, int) command for a spinner inside a modeless propertyPage. I understand the usual place is in OnInitDlg. However, I don't think there is a similar OnInit function for my property page/sheet. Thanks! ;)

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      OnInitDialog is OK, assuming that range remains the same during the lifetime of your object. Tomasz Sowinski -- http://www.shooltz.com.pl

      J 1 Reply Last reply
      0
      • T Tomasz Sowinski

        OnInitDialog is OK, assuming that range remains the same during the lifetime of your object. Tomasz Sowinski -- http://www.shooltz.com.pl

        J Offline
        J Offline
        Jerry Wang 0
        wrote on last edited by
        #3

        Yes, I would put SetRange in OnInitDialog too in a heart beat, but CPropertySheet class does not have the OnInitDialog function for me to inherit like in CDialog... so I'm lost for ways there.

        T 1 Reply Last reply
        0
        • J Jerry Wang 0

          Yes, I would put SetRange in OnInitDialog too in a heart beat, but CPropertySheet class does not have the OnInitDialog function for me to inherit like in CDialog... so I'm lost for ways there.

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          Just use this:

          BOOL CYourPage::OnInitDialog()
          {
          CPropertyPage::OnInitDialog();
          // your stuff here
          return TRUE;
          }

          Tomasz Sowinski -- http://www.shooltz.com.pl

          J 1 Reply Last reply
          0
          • T Tomasz Sowinski

            Just use this:

            BOOL CYourPage::OnInitDialog()
            {
            CPropertyPage::OnInitDialog();
            // your stuff here
            return TRUE;
            }

            Tomasz Sowinski -- http://www.shooltz.com.pl

            J Offline
            J Offline
            Jerry Wang 0
            wrote on last edited by
            #5

            Hmm.. there is no OnInitDialog() fcn in CPropertyPage or any of its parents. This exactly what I am stuck on. I know I can initialize my SetRange in OnInitDialog if I had a dialog, but I don't I have a CPropertyPage. btw, the tree for these classes is: . . . . . . . . . . . . . . . . . . . . . . . .-> CDialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / . . . . . . . . . . . CObject -> CCmdTarget -> CWnd -<. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .-> CPropertySheet. . . So there's no OnInitDialog for CPropertySheet.

            T 1 Reply Last reply
            0
            • J Jerry Wang 0

              Hmm.. there is no OnInitDialog() fcn in CPropertyPage or any of its parents. This exactly what I am stuck on. I know I can initialize my SetRange in OnInitDialog if I had a dialog, but I don't I have a CPropertyPage. btw, the tree for these classes is: . . . . . . . . . . . . . . . . . . . . . . . .-> CDialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . / . . . . . . . . . . . CObject -> CCmdTarget -> CWnd -<. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .-> CPropertySheet. . . So there's no OnInitDialog for CPropertySheet.

              T Offline
              T Offline
              Tomasz Sowinski
              wrote on last edited by
              #6

              CPropertyPage derives from CDialog - your tree is not based on facts :) . If you insert CPropertySheet::OnInitDialog() into CYourPage::OnInitDialog, the CDialog::OnInitDialog will be called. Anyway, if you don't want to use OnInitDialog, use OnSetActive or DoDataExchange instead. Tomasz Sowinski -- http://www.shooltz.com.pl

              J 1 Reply Last reply
              0
              • T Tomasz Sowinski

                CPropertyPage derives from CDialog - your tree is not based on facts :) . If you insert CPropertySheet::OnInitDialog() into CYourPage::OnInitDialog, the CDialog::OnInitDialog will be called. Anyway, if you don't want to use OnInitDialog, use OnSetActive or DoDataExchange instead. Tomasz Sowinski -- http://www.shooltz.com.pl

                J Offline
                J Offline
                Jerry Wang 0
                wrote on last edited by
                #7

                Ah, yes you are correct! I was looking into the wrong place -- the CPropertySheet, instead of CPropertyPage. Thanks! My spinner works like a charm now :)

                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