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