CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010
    Posts
    13

    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

  2. #2
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster ovidiucucu has a reputation beyond repute (3000+) ovidiucucu has a reputation beyond repute (3000+) ovidiucucu has a reputation beyond repute (3000+) ovidiucucu has a reputation beyond repute (3000+) ovidiucucu has a reputation beyond repute (3000+) ovidiucucu has a reputation beyond repute (3000+) ovidiucucu has a reputation beyond repute (3000+) ovidiucucu has a reputation beyond repute (3000+) ovidiucucu has a reputation beyond repute (3000+) ovidiucucu has a reputation beyond repute (3000+) ovidiucucu has a reputation beyond repute (3000+)
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    7,888

    Re: Moving Between Pages

    What you are describing looks like a Property Sheet in wizard mode.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

  3. #3
    Join Date
    Apr 2010
    Posts
    13

    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

  4. #4
    Join Date
    Jan 2003
    Location
    Wallisellen (Zürich), Switzerland
    Posts
    16,181

    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

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts



HTML5 Development Center

Click Here to Expand Forum to Full Width