我正在使用Process.Start()在我的WPF应用程序中弹出一个网页。通过这种方式,它在我的默认浏览器中打开。
在HTML/Javascript中,你可以弹出窗口,但窗口没有菜单栏、滚动条、工具栏等。用Process.Start()可以做到这一点吗?
创建一个包含WebBrowser
对象的ChildWindow
(从扩展工具包,或者只是另一个标准WPF Window
)怎么样?
你会很容易摆脱边界,滚动条。。。除了页面之外的任何控件(您也可以在窗口中轻松地拉伸它!)。。。
<Window x:Class="TestWpf.TestBrowser"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="TestBrowser">
<Grid>
<WebBrowser Source="http://www.ribo.it/"
HorizontalAlignment="Center"
Width="300" Height="300" />
</Grid>
</Window>
然后像往常一样显示浏览器窗口:
TestBrowser window = new TestBrowser();
window.Show();