我只想在WPF页面之间切换,但得到上面提到的错误:页面只能有Window或Frame作为父页面。 这里是我的代码页面只能有Window或Frame作为父页面
Imports System.Windows.Forms
公共类第1页
Private Sub btn1_Click(sender As Object, e As RoutedEventArgs) Handles btn1.Click
Try
Dim dd As New Page2
Me.Content = dd
Me.txt1.Text = (dd.txt10.Text)
Catch ex As Exception
txt1.Text = ex.Message
End Try
XAML文件的代码
<Page x:Class="Page2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="Page2">
<Grid>
<Button x:Name="button1" Content="Button" HorizontalAlignment="Left" Margin="163,62,0,0" VerticalAlignment="Top" Width="101" Height="55"/>
<TextBox x:Name="txt10" HorizontalAlignment="Left" Height="23" Margin="38,81,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120"/>
</Grid>
请指导我什么,我做错了什么?
不,我没有删除它我的错误改变了,但仍然没有解决问题,所以我发布它与新的错误信息。第一个错误就是要在这里描述的第二个“show.me”? –