簡體   English   中英

WPF Web瀏覽器在透明窗口上

[英]wpf webbrowser on transparent window

我在窗口中有一個WPF WebBrowser控件。

我想刪除默認的窗口控件,所以我設置了AllowsTransparency =“ True”WindowStyle =“ None”

<Window x:Class="InstallerToolkit.InteractiveDemosWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="870" Width="1110" WindowStyle="None"  AllowsTransparency="True"  WindowStartupLocation="CenterScreen">
<Grid>
    <WebBrowser Name="WebBrowser" HorizontalAlignment="Left" Height="795" Margin="10,35,0,0" VerticalAlignment="Top" Width="1082" />    
</Grid>

這導致我無法查看我的Web瀏覽器內容。 如果刪除了AllowsTransparency =“ True”,則可以通過網頁查看,但是現在有了不需要的默認控件。

我該如何解決?

如果您正在尋找的功能確實是AllowTransparency,則可以將其更新為WPF 4.5(他們已對空域問題進行了修復),請閱讀此內容以獲取更多詳細信息。

如果您無法升級WPF版本,則需要禁用調整大小,如其他人所述。

添加ResizeMode = NoResize應該可以擺脫控件。 我應該提到AllowTransparency = True會降低性能! 根據軟件類型,嘗試避免使用該軟件!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM