使用VB.Net的WPF应用程序编程(菜单) [英] WPF application programming with VB.Net (menus)
问题描述
网站上的任何想法或可以指导我在VB.Net中创建WPF应用程序的材料.
这是我第一次使用它,我不确定如何向控件中添加函数,例如,这是我的WPF代码:
Any ideas on websites or material that can guide me through creating a WPF application in VB.Net.
This is my first time using this and I am not sure how to add functions to my controls for example this is my WPF code:
<pre lang="HTML"><Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="481" Width="675" DataContext="{Binding}">
<Grid>
<Menu Height="27" HorizontalAlignment="Left" Margin="2,0,0,0" Name="Menu1" VerticalAlignment="Top" Width="651">
<Menu.Background>
<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
<GradientStop Color="Black" Offset="0" />
<GradientStop Color="White" Offset="0.058" />
</LinearGradientBrush>
</Menu.Background>
<MenuItem Header="File" Name="File">
<MenuItem Header="New File" Command="ApplicationCommands.New" IsCheckable="True" />
<MenuItem Header="Open" Command="ApplicationCommands.Open" IsCheckable="True" />
<MenuItem Header="Save" Command="ApplicationCommands.Save" IsCheckable="True" />
<MenuItem Header="Save As" Command="ApplicationCommands.SaveAs" IsCheckable="True" />
<MenuItem Header="Close" Command="ApplicationCommands.Close" IsCheckable="True" />
</MenuItem>
<MenuItem Header="Setup" Name="Setup">
<MenuItem Header="Customer information" IsCheckable="False" IsEnabled="False" />
<Separator />
</MenuItem>
<MenuItem Header="Reports" />
<MenuItem Header="Calculation tools" />
</Menu>
<Image Height="126" HorizontalAlignment="Left" Margin="246,157,0,0" Name="Image1" Stretch="Fill" VerticalAlignment="Top" Width="189" Source="/WpfApplication1;component/Images/Baker%20Blue%20and%20black.jpg" />
<Grid.Background>
<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
<GradientStop Color="Black" Offset="0" />
<GradientStop Color="#FFB5FFF9" Offset="0.512" />
</LinearGradientBrush>
</Grid.Background>
</Grid>
</Window>
现在,在菜单栏上,我已将导航功能置于位置",但不知道如何使菜单项实际进行导航.
Windows应用程序示例,允许我单击菜单并导航到纯VB中的form2,我只需输入以下代码:
Now on my menu bar I have the navigations functions in Place but do not know how to make the menu items actually navigate.
Example a Windows for application that allow me to click on the menu and navigate to form2 in plain VB I would simply enter the following code:
Private Sub InventorySteupToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InventorySteupToolStripMenuItem.Click
'Inventory setup directory
Inventory.Show()
Inventory.MdiParent = Me
End Sub
不知道如何使两个相互之间.请帮助.
Not sure how to make the two tak to each other. Plese help.
推荐答案
此处提供了大量资源和文章. CodeProject [ ^ ].
这篇关于使用VB.Net的WPF应用程序编程(菜单)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!