资源简介
CefSharp模仿浏览器Tab分页,刷新,删除,新窗口。不能运行请把dll文件夹的 (icudt.dll,libcef.dll)复制到x68/debug里即可!
代码片段和文件信息
using CefSharp.WinForms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace myie
{
public partial class cc : Form
{
public cc()
{
InitializeComponent();
}
private void cc_Load(object sender EventArgs e)
{
tableLayoutPanel1.Dock = Dockstyle.Fill;
tabControl1.Dock = Dockstyle.Fill;
iehelper.TCL = tabControl1;
iehelper.tbox = txtUrl;
FirstLoad();
}
protected void FirstLoad()
{
string strUrl = iehelper.GetUrl(txtUrl.Text.Trim());
WebView wv = iehelper.SetWebViewer(strUrl);
TabPage tpage = (TabPage)tabControl1.Controls[tabControl1.SelectedIndex];
tpage.Controls.Add(wv);
txtUrl.Text = wv.Address;
}
private void btnBack_Click(object sender EventArgs e)
{
WebView wv = (WebView)tabControl1.Controls[tabControl1.SelectedIndex].Controls[0];
wv.Back();
txtUrl.Text = wv.Address;
}
private void btnForward_Click(object sender EventArgs e)
{
WebView wv = (WebView)tabControl1.Controls[tabControl1.SelectedIndex].Controls[0];
wv.Forward();
txtUrl.Text = wv.Address;
}
private void btnAddTab_Click(object sender EventArgs e)
{
string strUrl = System.AppDomain.CurrentDomain.baseDirectory + “default.html“;
WebView wv = iehelper.SetWebViewer(strUrl);
TabPage tpage = new TabPage();
tpage.Controls.Add(wv);
int ino = tabControl1.Controls.Count;
tpage.Name = ino.ToString();
tpage.Text = ino.ToString();
tabControl1.Controls.Add(tpage);
tabControl1.Dock = Dockstyle.Fill;
tabControl1.SelectedIndex = ino;
}
private void txtUrl_KeyDown(object sender KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.btnGOUrl_Click(sender e);
}
}
private void btnGOUrl_Click(object sender EventArgs e)
{
string strUrl = iehelper.GetUrl(txtUrl.Text.Trim());
WebView wv = iehelper.SetWebViewer(strUrl);
TabPage tpage = (TabPage)tabControl1.Controls[tabControl1.SelectedIndex];
iehelper.DisWebViewer(tpage);
tpage.Controls.Clear();
tpage.Controls.Add(wv);
txtUrl.Text = wv.Address;
}
private void btnLastPage_Click(object sender EventArgs e)
{
GoLastNextPage(0);
}
private void btnNextPage_Click(object sender EventArgs e)
{
GoLastNextPage(1);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-04-28 15:47 CEF中Tab分页\
目录 0 2015-11-02 11:12 CEF中Tab分页\myie\
文件 134 2015-11-02 09:30 CEF中Tab分页\myie\app.config
目录 0 2015-11-02 10:21 CEF中Tab分页\myie\bin\
目录 0 2015-11-02 10:21 CEF中Tab分页\myie\bin\Debug\
文件 134 2015-11-02 09:30 CEF中Tab分页\myie\bin\Debug\myie.exe.config
文件 22704 2015-11-02 09:30 CEF中Tab分页\myie\bin\Debug\myie.vshost.exe
文件 134 2015-11-02 09:30 CEF中Tab分页\myie\bin\Debug\myie.vshost.exe.config
目录 0 2015-11-03 16:54 CEF中Tab分页\myie\bin\Release\
目录 0 2015-11-02 10:21 CEF中Tab分页\myie\bin\x86\
目录 0 2017-06-12 14:47 CEF中Tab分页\myie\bin\x86\Debug\
目录 0 2015-11-02 10:21 CEF中Tab分页\myie\bin\x86\Debug\--plugins\
文件 856 2009-07-17 20:06 CEF中Tab分页\myie\bin\x86\Debug\--plugins\flashpla
文件 19620 2009-07-17 20:07 CEF中Tab分页\myie\bin\x86\Debug\--plugins\install.js
文件 19620 2009-07-17 20:07 CEF中Tab分页\myie\bin\x86\Debug\--plugins\install.js.old
文件 3883424 2009-07-17 20:21 CEF中Tab分页\myie\bin\x86\Debug\--plugins\NPSWF32.dll
文件 257440 2009-07-17 20:21 CEF中Tab分页\myie\bin\x86\Debug\--plugins\NPSWF32_FlashUtil.exe
文件 303616 2013-12-18 03:34 CEF中Tab分页\myie\bin\x86\Debug\CefSharp.dll
文件 171008 2013-12-18 03:34 CEF中Tab分页\myie\bin\x86\Debug\CefSharp.WinForms.dll
文件 78 2017-06-12 14:44 CEF中Tab分页\myie\bin\x86\Debug\debug.log
文件 7752 2015-10-28 16:59 CEF中Tab分页\myie\bin\x86\Debug\default.html
目录 0 2015-11-02 10:21 CEF中Tab分页\myie\bin\x86\Debug\locales\
文件 4798 2013-12-18 03:38 CEF中Tab分页\myie\bin\x86\Debug\locales\am.pak
文件 4872 2013-12-18 03:38 CEF中Tab分页\myie\bin\x86\Debug\locales\ar.pak
文件 5268 2013-12-18 03:38 CEF中Tab分页\myie\bin\x86\Debug\locales\bg.pak
文件 6678 2013-12-18 03:38 CEF中Tab分页\myie\bin\x86\Debug\locales\bn.pak
文件 3351 2013-12-18 03:38 CEF中Tab分页\myie\bin\x86\Debug\locales\ca.pak
文件 3480 2013-12-18 03:38 CEF中Tab分页\myie\bin\x86\Debug\locales\cs.pak
文件 2984 2013-12-18 03:38 CEF中Tab分页\myie\bin\x86\Debug\locales\da.pak
文件 3472 2013-12-18 03:38 CEF中Tab分页\myie\bin\x86\Debug\locales\de.pak
文件 5544 2013-12-18 03:38 CEF中Tab分页\myie\bin\x86\Debug\locales\el.pak
............此处省略142个文件信息
评论
共有 条评论