Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CPropertySheet/Page - There has got to be a better way.

Status
Not open for further replies.

kwijibo

Programmer
Jan 12, 2005
15
AU
I have a PropertySheet based application and am trying to update the data members & controls on the respective PropertyPages, from within the PropertySheet, in response to a button push.

Currently, I am using this code:
Code:
int originalPage = GetActiveIndex();

SetActivePage(PAGENO_SYSCONF);
m_System.UpdateToControls();

SetActivePage(PAGENO_ANTENNA);
m_Antennas.UpdateToControls();

... (more of the same for each page) ...

SetActivePage(originalPage);

With UpdateToControls defined in the relative .h files as:

Code:
// Update functions
void UpdateToControls() { UpdateData(FALSE); };
void UpdateFromControls() { UpdateData(TRUE); };

Obviously there must be a better way, as visual flicker is apparent when each PropertyPage is made active. Also, the controls fail to update on the page which is initially active. If I repeat the process starting on a different page the problem always shifts to the active page. In other words, providing the page was not initially active when the button was pushed, the code will update the page's controls.

Is there a way I can set a page active without updating the screen, and does anyone know why this code would not work for the page with active focus? Is there another way to transfer data between sheet and page for which I am unaware?

Thanks in advance.

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top