我通过使用 Visual Studio 在 WPF 中编写了一个程序,我的程序运行良好。当我发布它时,它看起来就像 Internet Explorer 上的下图一样。我只想在上面看到我的应用程序。
这是我目前的看法
这就是我想要的
Page1.XML
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page1">
<Grid>
<StackPanel Margin="0,0,0,0" Name="stackPanel"
HorizontalAlignment="Left" VerticalAlignment="Top" />
</Grid>
Page1.xaml.cs
using System.Windows.Controls;
using System.Windows.Forms.Integration;
using BenzinTakip;
namespace WPFHost
{
/// <summary>
/// Interaction logic for Page1.xaml
/// </summary>
public partial class Page1 : Page
{
private readonly Form1 mainForm = new Form1();
public Page1()
{
InitializeComponent();
//Create a Windows Forms Host to host a form
WindowsFormsHost windowsFormsHost = new WindowsFormsHost();
mainForm.TopLevel = false;
windowsFormsHost.Child = mainForm;
stackPanel.Children.Add(windowsFormsHost);
}
}
}
饮歌长啸
扬帆大鱼
哔哔one
相关分类