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. More property sheet questions

More property sheet questions

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutoriallounge
8 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.
  • B Offline
    B Offline
    bcemick
    wrote on last edited by
    #1

    Sorry to have to ask these, but Project Sheets (and working with tabs in general) is completely knew to me and the MSDN is vague on some of these things. Okay, so I have my Property Sheet set up and I've added 5 Property Pages to it. In each page is a list control (report style) that has to have headers for each column. I can set the headers with the first one (PropertyPage) but none of the others (PropertyPage1, PropertyPage2, etc). Is there something that I'm missing as how to reference those particular pages? Next, adding buttons (yes, I asked this before; sorry for the repeat question). I know how to create the buttons, but for some reason they're not showing up in the Propery Sheet at all. I don't want buttons in the Property Pages, but rather outside of them on the Sheet itself. Right now, it looks something like this: pWnd = GetParent(); m_btnRead.Create("Text Goes Here", WS_VISIBLE | BS_PUSHBUTTON, CRect(10, 50, 100, 208), pWnd, 1); I've also tried replacing "pWnd" with "this". Nothing. No button anywhere. Again, am I missing how to correctly reference the Sheet? Any help is greatly appreciated.

    D PJ ArendsP 2 Replies Last reply
    0
    • B bcemick

      Sorry to have to ask these, but Project Sheets (and working with tabs in general) is completely knew to me and the MSDN is vague on some of these things. Okay, so I have my Property Sheet set up and I've added 5 Property Pages to it. In each page is a list control (report style) that has to have headers for each column. I can set the headers with the first one (PropertyPage) but none of the others (PropertyPage1, PropertyPage2, etc). Is there something that I'm missing as how to reference those particular pages? Next, adding buttons (yes, I asked this before; sorry for the repeat question). I know how to create the buttons, but for some reason they're not showing up in the Propery Sheet at all. I don't want buttons in the Property Pages, but rather outside of them on the Sheet itself. Right now, it looks something like this: pWnd = GetParent(); m_btnRead.Create("Text Goes Here", WS_VISIBLE | BS_PUSHBUTTON, CRect(10, 50, 100, 208), pWnd, 1); I've also tried replacing "pWnd" with "this". Nothing. No button anywhere. Again, am I missing how to correctly reference the Sheet? Any help is greatly appreciated.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      bcemick wrote: Okay, so I have my Property Sheet set up and I've added 5 Property Pages to it. In each page is a list control (report style) that has to have headers for each column. I can set the headers with the first one (PropertyPage) but none of the others (PropertyPage1, PropertyPage2, etc). Is there something that I'm missing as how to reference those particular pages? How and where are you inserting the columns in each list control?


      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

      B 1 Reply Last reply
      0
      • D David Crow

        bcemick wrote: Okay, so I have my Property Sheet set up and I've added 5 Property Pages to it. In each page is a list control (report style) that has to have headers for each column. I can set the headers with the first one (PropertyPage) but none of the others (PropertyPage1, PropertyPage2, etc). Is there something that I'm missing as how to reference those particular pages? How and where are you inserting the columns in each list control?


        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

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

        For the first Property Page, I have this: m_lstPage1.InsertColumn(0, "Text here", LVCFMT_CENTER, 50, -1); m_lstPage1.InsertColumn(1, "Text here", LVCFMT_LEFT, 100, -1); m_lstPage1.InsertColumn(2, "Text here", LVCFMT_CENTER, 100, -1); m_lstPage1.InsertColumn(3, "Text here", LVCFMT_CENTER, 100, -1); m_lstPage1.InsertColumn(4, "Text here", LVCFMT_RIGHT, 100, -1); m_lstPage1.InsertColumn(5, "Text here", LVCFMT_CENTER, 100, -1); m_lstPage1.InsertColumn(6, "Text here", LVCFMT_CENTER, 100, -1); Now, if I try to say something like: m_lstPage2.InsertColumn(0, "Vol #", LVCFMT_CENTER, 50, -1); I get an error that says "m_lstPage1 : undeclared identifier" even though it is declared.

        D 1 Reply Last reply
        0
        • B bcemick

          For the first Property Page, I have this: m_lstPage1.InsertColumn(0, "Text here", LVCFMT_CENTER, 50, -1); m_lstPage1.InsertColumn(1, "Text here", LVCFMT_LEFT, 100, -1); m_lstPage1.InsertColumn(2, "Text here", LVCFMT_CENTER, 100, -1); m_lstPage1.InsertColumn(3, "Text here", LVCFMT_CENTER, 100, -1); m_lstPage1.InsertColumn(4, "Text here", LVCFMT_RIGHT, 100, -1); m_lstPage1.InsertColumn(5, "Text here", LVCFMT_CENTER, 100, -1); m_lstPage1.InsertColumn(6, "Text here", LVCFMT_CENTER, 100, -1); Now, if I try to say something like: m_lstPage2.InsertColumn(0, "Vol #", LVCFMT_CENTER, 50, -1); I get an error that says "m_lstPage1 : undeclared identifier" even though it is declared.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          But where are you trying to insert these columns from?


          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          B 1 Reply Last reply
          0
          • D David Crow

            But where are you trying to insert these columns from?


            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

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

            Oh. Here's the code: BOOL CPropertyPage::OnInitDialog() { CPropertyPage::OnInitDialog(); // TODO: Add extra initialization here SetColumnHeaders(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CPropertyPage::SetColumnHeaders() { m_lstPage1.InsertColumn(0, "Text here", LVCFMT_CENTER, 50, -1); m_lstPage1.InsertColumn(1, "Text here", LVCFMT_LEFT, 100, -1); m_lstPage1.InsertColumn(2, "Text here", LVCFMT_CENTER, 100, -1); m_lstPage1.InsertColumn(3, "Text here", LVCFMT_CENTER, 100, -1); m_lstPage1.InsertColumn(4, "Text here", LVCFMT_RIGHT, 100, -1); m_lstPage1.InsertColumn(5, "Text here", LVCFMT_CENTER, 100, -1); m_lstPage1.InsertColumn(6, "Text here", LVCFMT_CENTER, 100, -1); } This is all inside the Property Page class.

            B 1 Reply Last reply
            0
            • B bcemick

              Oh. Here's the code: BOOL CPropertyPage::OnInitDialog() { CPropertyPage::OnInitDialog(); // TODO: Add extra initialization here SetColumnHeaders(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CPropertyPage::SetColumnHeaders() { m_lstPage1.InsertColumn(0, "Text here", LVCFMT_CENTER, 50, -1); m_lstPage1.InsertColumn(1, "Text here", LVCFMT_LEFT, 100, -1); m_lstPage1.InsertColumn(2, "Text here", LVCFMT_CENTER, 100, -1); m_lstPage1.InsertColumn(3, "Text here", LVCFMT_CENTER, 100, -1); m_lstPage1.InsertColumn(4, "Text here", LVCFMT_RIGHT, 100, -1); m_lstPage1.InsertColumn(5, "Text here", LVCFMT_CENTER, 100, -1); m_lstPage1.InsertColumn(6, "Text here", LVCFMT_CENTER, 100, -1); } This is all inside the Property Page class.

              B Offline
              B Offline
              bcemick
              wrote on last edited by
              #6

              I think I got it figured out. I needed a separate function for each page in the Property Sheet. But I'm still having a problem with placing buttons on the Property Sheet. No matter what I do, the button will not show up. Any ideas or suggestions are appreciated.

              D 1 Reply Last reply
              0
              • B bcemick

                Sorry to have to ask these, but Project Sheets (and working with tabs in general) is completely knew to me and the MSDN is vague on some of these things. Okay, so I have my Property Sheet set up and I've added 5 Property Pages to it. In each page is a list control (report style) that has to have headers for each column. I can set the headers with the first one (PropertyPage) but none of the others (PropertyPage1, PropertyPage2, etc). Is there something that I'm missing as how to reference those particular pages? Next, adding buttons (yes, I asked this before; sorry for the repeat question). I know how to create the buttons, but for some reason they're not showing up in the Propery Sheet at all. I don't want buttons in the Property Pages, but rather outside of them on the Sheet itself. Right now, it looks something like this: pWnd = GetParent(); m_btnRead.Create("Text Goes Here", WS_VISIBLE | BS_PUSHBUTTON, CRect(10, 50, 100, 208), pWnd, 1); I've also tried replacing "pWnd" with "this". Nothing. No button anywhere. Again, am I missing how to correctly reference the Sheet? Any help is greatly appreciated.

                PJ ArendsP Offline
                PJ ArendsP Offline
                PJ Arends
                wrote on last edited by
                #7

                bcemick wrote: m_btnRead.Create("Text Goes Here", WS_VISIBLE | BS_PUSHBUTTON, CRect(10, 50, 100, 208), pWnd, 1); You need the WS_CHILD style, WS_TABSTOP would also be helpful if you want to be able to use the tab key to get to your buttons. Also, make sure the rect you specify is in your sheets client coordinates, and not off the sheet somewhere.


                "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!


                Honoured as one of The Most Helpful Members of 2004

                Within you lies the power for good; Use it!

                1 Reply Last reply
                0
                • B bcemick

                  I think I got it figured out. I needed a separate function for each page in the Property Sheet. But I'm still having a problem with placing buttons on the Property Sheet. No matter what I do, the button will not show up. Any ideas or suggestions are appreciated.

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  bcemick wrote: I think I got it figured out. I needed a separate function for each page in the Property Sheet Correct. For each page/tab on the sheet, a separate CPropertyPage object is needed.


                  "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                  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