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

Thread: Menu and Content not working.

  1. #1
    Join Date
    Dec 2005

    Menu and Content not working.

    I'm new to WPF. I've just been trying to put a menu bar and a grid object in a window, but I always get the exception that I am trying to set a content property more than once. I can't figure out how to put a menu along with other elements in the window.

    <Window x:Class="WpfApplication1.MainWindow"
        Title="Eliptical Button">
            <Menu IsMainMenu="True">
                <MenuItem Header="File">
                    <MenuItem Header="New"/>
                    <MenuItem Header="Open"/>
                    <MenuItem Header="Save"/>
                    <MenuItem Header="Save As..."/>
                    <MenuItem Header="Exit"/>
                <MenuItem Header="Edit"/>
    Can someone please help me to get this right? Thanks.

  2. #2
    Join Date
    Sep 2010

    Re: Menu and Content not working.

    you must put the menu and the grid with the button (or just the button) in a single main grid so the main window will have only one child

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)