Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to code a menu un a browser
Message
From
25/02/2010 03:19:16
 
 
To
24/02/2010 17:42:51
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Environment versions
Environment:
VB 9.0
Miscellaneous
Thread ID:
01450668
Message ID:
01450924
Views:
44
Hi,

I see that John has pointed out the invalid comment syntax.
Couple of other points :
The Window Name attribute value cannot be the same as the class name
The SizeToContent setting will override the Width and Height settings for the Window - use one or the other. Here's a working version:
<Window x:Class="Browser"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="My Own Wpf Browser" Height="480" Width="640"  Name="MyBrowser"
    WindowStartupLocation="CenterScreen" >
    <Grid Name="grid1">
        <DockPanel x:Uid="DockPanel_1">
            <Menu x:Uid="Menu_1" Background="White" Name="_MainMenu" DockPanel.Dock="Top">
                <!-- Navigate Menu-->
                <MenuItem x:Uid="NavigateMenu" Header="_Navigate" />
                <!--Help Menu -->
                <MenuItem x:Uid="HelpMenu" Header="_Help">
                    <MenuItem x:Uid="AboutMenu" Header="_About" />
                </MenuItem>
            </Menu>
        </DockPanel>
    </Grid>
</Window>
>here is the code where i have and error in "!Menu" adn other parts and i pste it from a book of microsoft
>
>
><Window x:Class="Browser"
>    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>    Title="My Own Wpf Browser" Height="480" Width="640" Name="Browser"
>    Icon="face02.ico" SizeToContent="WidthAndHeight"
>    WindowStartupLocation="CenterScreen"   >
>    
>   <Grid Name="grid1">
>    <DockPanel x:Uid="DockPanel_1">
>        < !Menu Bar>
>        <Menu x:Uid="Menu_1" Background="White" Name="_MainMenu" DockPanel.Dock="Top">
>            <! Navigate Menu>
>            <MenuItem x:Uid="NavigateMenu" Header="_Navigate" />
>                <! Help Menu>
>                <MenuItem x:Uid="HelpMenu" Header="_Help">
>                    <MenuItem x:Uid="AboutMenu" Header="_About" />
>                    </MenuItem>
>        </Menu>
>    </DockPanel>
>    </Grid>
>
></Window>
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform