CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2020
    Posts
    14

    How do you manage windows?

    Like you have 2 buttons. Lets call them

    Menu, Tables

    When you press Menu , you want to display the menu
    but the other buttons not to show.

    When you press Tables, you want to display Tables.
    but the other buttons not to show

    This can become messy if i live it on one window so we can use UserControl to do this? and what would be the most appropritate way to do this?

    Code:
    void Menu(){
    //Show Menu
    //Close Reports
    //Close Tables
    //Close Beaches
    }
    
    void Reports(){
    //Show Reports
    //Close Menu
    //Close Table
    //Close Beaches
    }
    But imagine having more items and you would have to go over each one and each one to turn them off... it will become a mess.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How do you manage windows?

    You can use a tab control with its styling set to hide the tabs. Each 'tab' contains the view you wish to display.

    Your menu simply sets the active tab.

    Search bing or google for "wpf tab control hide tab".

    [Edit] there might be a newer way to do this now, but back then using the tab control with hidden tabs was the way to go.
    Last edited by Arjay; August 29th, 2020 at 11:10 PM.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured