WPF -- WebBroswer cannot display problems

Source: Internet
Author: User

View plaincopyprint?
 
The WebBroswer control placed in Windows in WPF cannot be displayed:
The source code is as follows:
[Html]
<Window x: Class = "MutilScreenDemo. MainWindow"
Xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml"
Xmlns: d = "http://schemas.microsoft.com/expression/blend/2008"
Xmlns: mc = "http://schemas.openxmlformats.org/markup-compatibility/2006"
Title = "MainWindow"
AllowsTransparency = "True"
Background = "Black"
BorderBrush = "Transparent"
BorderThickness = "0"
D: design height = "348"
D: DesignWidth = "892"
Loaded = "Window_Loaded"
ResizeMode = "NoResize"
WindowStyle = "None"
Mc: Ignorable = "d">
 
<Grid x: Name = "layoutRoot">
<Grid. RowDefinitions>
<RowDefinition Height = "100" type = "regxph" text = "yourobjectname"/>
<RowDefinition Height = "*"/>
</Grid. RowDefinitions>
<Rectangle Height = "2"
VerticalAlignment = "Bottom"
Fill = "White"/>
<TextBlock Name = "txtShow"
Grid. Row = "0"
HorizontalAlignment = "Left"
VerticalAlignment = "Center"
FontSize = "50"
FontWeight = "Bold"
Foreground = "Red"
Text = "Hello World! "/>
<StackPanel Grid. Row = "0"
HorizontalAlignment = "Right"
VerticalAlignment = "Center"
Orientation = "Horizontal">
<Button Name = "button1"
Margin = "5"
HorizontalAlignment = "Right"
VerticalAlignment = "Top"
Click = "button#click"
Content = "Get Screen Info"
Padding = "20"/>
<Button Name = "btnShutdown"
Margin = "5"
HorizontalAlignment = "Right"
VerticalAlignment = "Top"
Click = "btnShutdown_Click"
Content = "ShutDown App"
Padding = "20"/>
</StackPanel>
[Html]
 
[Html]
<WebBrowser Name = "broswer"
Grid. Row = "1"/>
</Grid>
/Window>

Display Effect:


After tossing and trying, the problem lies in the AllowsTransparency attribute in the Window. When the WebBroswer control is displayed and AllowsTransparency is True, there is a conflict.
After AllowsTransparency is removed, the following results are displayed:


But I have no idea what it will do. Hope you can give me some advice !!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.