Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: C# and WPF

  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    C# and WPF

    I am trying to make an application, and I want to have a menu at the top, and then when i click on lets say Start on the menu bar, it changes the window, so that it still has the menu at the top but everything else has changes. I dun want to remake the window, and i dun want to have all of the things in code and just change the visibility.

    here is what i thought would work, creating UserControls and then change the UserControl.

    UserControl replace = new CreatePage();
    this.C = replace;

    CreatePage is a page that asks for a bunch of items. Please let me know what i should do.

    I do not get any sort of error, but nothing actually changes. Thanks for everyone helps

  • #2
    New Coder
    Join Date
    Jul 2007
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you kinda answered my question. here is my main predicament. I want to have a starting window. if you click a button it will show you something different. this different thing is called, and is a UserControl.

    How it is Called:

    void New_Click(object sender, RoutedEventArgs e)
    {
    this.Grid.Children.Remove(UC);
    this.Grid.Children.Add(create);
    }

    create was already initialized up top, and it has its own xaml and code behind file.

    So now the window is populated with all the original information but instead of UC in the main text area, i have put this new createplayer UserControl. Now its going to fill out some information in a form. then you would hit a submit button. I then want it to go back so that UC is the UserControl not create. Everything you entered into this form, is then saved into a class.

    What is the best way to do this? Let me know if anything is unclear


  •  

    Posting Permissions

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