45 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AIProofread.Controls
{
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public partial class FormWebView : BaseWinForm
{
public string WebUrl { get; set; }
public FormWebView(string url,int width,int height)
{
InitializeComponent();
this.WebUrl = url;
this.SetSize(width, height);
this.StartPosition = FormStartPosition.CenterScreen;
}
public void SetTitle(string title)
{
this.Text = title;
}
public void SetSize(int width, int height)
{
this.Width = width;
this.Height = height;
}
private void FormWebView_Load(object sender, EventArgs e)
{
// 初始化
InitWebView(WebView,this.WebUrl, "webview");
}
}
}