Moving Between Pages
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Moving Between Pages

  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
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,021

    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."
    Visit: Microsoft Virtual Academy
    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
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,360

    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
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center