123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using Chromium.WebBrowser;
- using NetDimension.NanUI;
- 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 LYFZ.Software.MainBusiness.MicroApplet
- {
- public partial class frmAdminPage : Formium
- {
- public frmAdminPage():
- base("")
- {
- InitializeComponent();
- try
- {
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
- this.LifeSpanHandler.OnBeforePopup += LifeSpanHandler_OnBeforePopup;
- this.KeyboardHandler.OnKeyEvent += KeyboardHandler_OnKeyEvent;
- }
- catch { }
- }
- int oldKey = 0;
- private void KeyboardHandler_OnKeyEvent(object sender, Chromium.Event.CfxOnKeyEventEventArgs e)
- {
- if (e.Event.WindowsKeyCode == (int)Keys.F12 && oldKey == 17)
- {
- oldKey = 0;
- this.OpenShowDevTools();
- }
- else
- {
- oldKey = e.Event.WindowsKeyCode;
- }
- }
- public new BrowserCore Chromium => base.Chromium;
- delegate void ShowDevToolsDelegate();
- void OpenShowDevTools()
- {
- try
- {
- if (this.InvokeRequired)
- {
- ShowDevToolsDelegate setValue = new ShowDevToolsDelegate(OpenShowDevTools);
- this.Invoke(setValue);
- }
- else
- {
- //this.ShowDevTools(this.Handle);
- this.Chromium.ShowDevTools(this.Handle);
- }
- }
- catch
- {
- }
- finally
- {
- }
- }
- void LifeSpanHandler_OnBeforePopup(object sender, Chromium.Event.CfxOnBeforePopupEventArgs e)
- {
-
- }
- /// <summary>
- /// 设置为内嵌窗体
- /// </summary>
- public void SetEmbeddedWindows()
- {
- // this.BorderSize = 0;
- this.BorderWidth = 0;
- this.FormBorderStyle = FormBorderStyle.None;
- this.Dock = System.Windows.Forms.DockStyle.Fill;
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
- this.EnableFormShadow = false;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.TopLevel = false;
- }
- /// <summary>
- /// 设置为内嵌窗体
- /// </summary>
- public void SetEmbeddedWindows(Control _Control)
- {
- this.SetEmbeddedWindows();
- _Control.Controls.Add(this);
- this.Show();
- }
-
- }
- }
|