-
June 14th, 2010, 04:43 PM
#1
Moving Between Pages
He im wondering on how to move between pages in a program.
I mean if there was the program at startup and say you wanted to look at stocks, you would click on that button and it would take you to the stocks page, and if you wanted to go back you would click a back button.
Would you have to hide all the controls using ShowWindow() and create a whole lot of new ones and vice versa for when the user clicks the other button?
Cheers,
RJK
-
June 16th, 2010, 02:41 AM
#2
Re: Moving Between Pages
What you are describing looks like a Property Sheet in wizard mode.
-
June 16th, 2010, 04:16 PM
#3
Re: Moving Between Pages
Thanks for the information, also is it possible to load controls from another C++ file:
e.g. I would want to load a button:
Code:
//Example
void LoadButton()
{
HWND hButton = CreateWindow("BUTTON", "Click Me", WS_CHILD | WS_VISIBLE, 10, 10, 120, 27, hwnd, NULL, (HINSTANCE) GetWindowLong(hButton, GWL_HINSTANCE), NULL);
}
And here it would be used:
Code:
//Example
#include "OtherFile.cpp"
extern void LoadButton();
.............
WM_CREATE:
{
LoadButton();
} break;
The program executes but it does not load the button, do the controls code have to be implemented within the WM_CREATE case or can they be loaded form other sources like my example?
Thanks,
RJK
-
June 16th, 2010, 04:29 PM
#4
Re: Moving Between Pages
Your "HWND hButton" is a local variable within void LoadButton() function. So it goes out of scope just as you return from LoadButton().
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|