【实例简介】
写入HTML来美化窗口
【实例截图】
【核心代码】
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BackgroundT
{
public partial class Form1 : Form
{
static string path = (System.Environment.CurrentDirectory).Replace(@"\", @"/"); //html 图片路径
static string nameq = "1";
string htmlname = @"
" nameq @"
";
public Form1()
{
InitializeComponent();
WebBrowser webBrowser = new WebBrowser();
webBrowser.Size = new Size(800, 450);
webBrowser.ScriptErrorsSuppressed = true;
webBrowser.ScriptErrorsSuppressed = true;
webBrowser.IsWebBrowserContextMenuEnabled = false;
webBrowser.AllowWebBrowserDrop = false;
webBrowser.WebBrowserShortcutsEnabled = false;
//webBrowser.Navigate(Application.StartupPath "../index.html");
webBrowser.DocumentText = htmlname;
this.Controls.Add(webBrowser);
}
private void skinButton1_Click(object sender, EventArgs e)
{
this.Close();
}
}
}