Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to code a menu un a browser
Message
De
25/02/2010 03:19:16
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
VB 9.0
Divers
Thread ID:
01450668
Message ID:
01450924
Vues:
45
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>
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform