zoukankan      html  css  js  c++  java
  • WPF显示Html

    WPF显示Html

    1.添加引用

    WindowsFormsIntegration.dll  

    System.Windows.Forms.dll

    2.界面内容

    <UserControl x:Class="HKDCMS.Client.Demo.UIViews.UIControls.AboutUsControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    mc:Ignorable="d" 
    Background="White"
    d:DesignHeight="300" d:DesignWidth="300">

    <Grid x:Name="grid"> </Grid>

    </UserControl>

    3.后台代码

    public partial class AboutUsControl : UserControl
    {
          public AboutUsControl()
         {
             InitializeComponent();

             System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
             System.Windows.Forms.WebBrowser web = new System.Windows.Forms.WebBrowser();
             web.Url = new Uri("http://www.cnblogs.com/");//此处Uri可以是浏览器中的路径,也可以是项目中的html页面路径
             host.Child = web;
             this.grid.Children.Add(host);
         }
    }

  • 相关阅读:
    动态代理
    构建一个REST风格的Web服务(Building a RESTful Web Service)
    使用Spring Boot构建应用程序(Building an Application with Spring Boot)
    SpringBoot笔记 三
    SpringBoot笔记 一
    redis的linux安装
    mysql的windows安装
    linux下Redis安装
    上网列表
    shell每日发邮件
  • 原文地址:https://www.cnblogs.com/lqs888/p/7122017.html
Copyright © 2011-2022 走看看