WPF浏览器控件不显示 [英] WPF Browser Control not displaying
问题描述
您好,
我正在开发一个必须连接到互联网的应用程序,为此,我使用内置的WPF浏览器控件。为了满足整体应用的主题,我也修改了浏览器窗口的界面,但是当我运行时,虽然该站点在WPF浏览器控件中打开,但它没有出现。
Hello,
I''m developing an application which have to connect to internet, for this, i''m using built-in Browser control of WPF. To meet the theme of overall application, i modified the interface of the browser window also, but when i run, although the site opens in WPF Browser control, but it not appears.
<window x:class="SkltnApplication3.Browser" xmlns:x="#unknown">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Browser" Height="600" Width="800" Background="Transparent" AllowsTransparency="True" WindowStyle="None" Loaded="Window_Loaded_1" >
<Grid>
<Border BorderThickness="0" Margin="10" CornerRadius="15" Background="Silver">
<Border.BitmapEffect>
<DropShadowBitmapEffect />
</Border.BitmapEffect>
<TextBox TextWrapping="Wrap" Name="tbPin" Margin="20,542,294,10"/>
</Border>
<WebBrowser Name="browserControl" Margin="25,52,25,0" Height="488" VerticalAlignment="Top" Focusable="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.CanContentScroll="True" />
<Button Margin="500,552,160,20" Content="Send" Name="btnSend"/>
<Button Margin="650,552,25,20" Content="Refresh" Name="btnRefresh" Click="btnRefresh_Click"/>
<Label Margin="25,25,65,548" Content="www.twitter.com" Name="lblURL" />
<Button Margin="754,10,10,567" Name="btnExit" Content="X" Background="#FFB55050" FontWeight="ExtraBold" TextOptions.TextHintingMode="Animated" Click="btnExit_Click">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="0, 15, 0, 0"></Setter>
</Style>
</Button.Resources>
</Button>
</Grid>
</Window>
问题在于此XAML,当我删除
The problem is in this XAML, when I remove
AllowsTransparency="True" WindowStyle="None"
,浏览器出现。请帮助我,有没有办法显示它以满足我当前的界面,或者我必须禁用trasperency和windowStyle?
这里是图片
, the browser appears. Kindly help me, is there a way to display it to meet my current interface, or i have to disable trasperency and windowStyle?
here is the image
推荐答案
看起来好像在这里回答:
http://social.msdn.microsoft.com/Forums/en- US / wpf / thread / cd8416be-deb0-496f-9e22-02e44e8073c0 / [ ^ ]。
参见: http://blogs.msdn.com/b/dwayneneed/archive /2008/09/08/transparent-windows-in-wpf.aspx [ ^ ]。
-SA
It looks like it was answered here:
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/cd8416be-deb0-496f-9e22-02e44e8073c0/[^].
See also: http://blogs.msdn.com/b/dwayneneed/archive/2008/09/08/transparent-windows-in-wpf.aspx[^].
—SA
这篇关于WPF浏览器控件不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!