private MyOpaqueLayer m_OpaqueLayer = null;//半透明蒙板层 /// <summary> /// 显示遮罩层 /// </summary> /// <param name="control">控件</param> /// <param name="alpha">透明度</param> /// <param name="isShowLoadingImage">是否显示图标</param> public void ShowOpaqueLayer(Control control, int alpha, bool isShowLoadingImage, bool opera = true) { try { if (this.m_OpaqueLayer == null) { this.m_OpaqueLayer = new MyOpaqueLayer(alpha, isShowLoadingImage); control.Controls.Add(this.m_OpaqueLayer); this.m_OpaqueLayer.Dock = DockStyle.Fill; this.m_OpaqueLayer.BringToFront(); if (!opera) { this.m_OpaqueLayer.LostFocus += new EventHandler((o, e) => { this.m_OpaqueLayer.Focus(); }); } else { this.m_OpaqueLayer.LostFocus -= new EventHandler((o, e) => { this.m_OpaqueLayer.Focus(); }); } this.m_OpaqueLayer.Focus(); } this.m_OpaqueLayer.Enabled = true; this.m_OpaqueLayer.Visible = true; } catch { } }
/// <summary> /// 显示遮罩层 /// </summary> /// <param name="control">控件</param> /// <param name="alpha">透明度</param> /// <param name="isShowLoadingImage">是否显示图标</param> public void ShowOpaqueLayer(Control control, int alpha, bool isShowLoadingImage,bool opera=true) { try { if (this.m_OpaqueLayer == null) { this.m_OpaqueLayer = new MyOpaqueLayer(alpha, isShowLoadingImage); control.Controls.Add(this.m_OpaqueLayer); this.m_OpaqueLayer.Dock = DockStyle.Fill; this.m_OpaqueLayer.BringToFront(); if(!opera) this.m_OpaqueLayer.LostFocus += new EventHandler((o, e) => { this.m_OpaqueLayer.Focus(); }); else this.m_OpaqueLayer.LostFocus -= new EventHandler((o, e) => { this.m_OpaqueLayer.Focus(); }); this.m_OpaqueLayer.Focus(); } this.m_OpaqueLayer.Enabled = true; this.m_OpaqueLayer.Visible = true; } catch { } }
public PaginationUtils(FlowLayoutPanel panel, CustomTipDialog customTipDialog, int[] pageSizeCollection, CustomPaginationQuery custQuery, MyOpaqueLayer myOpaqueLayer) { this.panel = panel; this.customTipDialog = customTipDialog; this.pageSizeCollection = pageSizeCollection; this.custQuery = custQuery; this.myOpaqueLayer = myOpaqueLayer; this.customTipDialog.Tag = this.myOpaqueLayer; }
/// <summary> /// 显示遮罩层 /// </summary> /// <param name="control"></param> /// <param name="alpha"></param> /// <param name="showLoadingImage"></param> protected void ShowOpaqueLayer(Control control, int alpha, bool showLoadingImage) { if (this.m_OpaqueLayer == null) { this.m_OpaqueLayer = new MyOpaqueLayer(alpha, showLoadingImage); control.Controls.Add(this.m_OpaqueLayer); this.m_OpaqueLayer.Dock = DockStyle.Fill; this.m_OpaqueLayer.BringToFront(); m_OpaqueLayer.Click += M_OpaqueLayer_Click; } this.m_OpaqueLayer.Enabled = true; this.m_OpaqueLayer.Visible = true; }
/// <summary> /// 显示遮罩层 /// </summary> /// <param name="control">控件</param> /// <param name="alpha">透明度</param> /// <param name="isShowLoadingImage">是否显示图标</param> public void ShowOpaqueLayer(Form form, int alpha, bool isShowLoadingImage, bool IsShowLabel, string Msg) { try { if (this.m_OpaqueLayer == null) { this.m_OpaqueLayer = new MyOpaqueLayer(alpha, isShowLoadingImage, IsShowLabel, Msg); form.Controls.Add(this.m_OpaqueLayer); this.m_OpaqueLayer.Dock = DockStyle.Fill; this.m_OpaqueLayer.BringToFront(); } this.m_OpaqueLayer.Enabled = true; this.m_OpaqueLayer.Visible = true; } catch { } }
/// <summary> /// 显示遮罩层 /// </summary> /// <param name="control">控件</param> /// <param name="alpha">透明度</param> /// <param name="isShowLoadingImage">是否显示图标</param> public void ShowOpaqueLayer(Control control, int alpha, bool isShowLoadingImage) { try { if (this.m_OpaqueLayer == null) { this.m_OpaqueLayer = new MyOpaqueLayer(alpha, isShowLoadingImage); control.Controls.Add(this.m_OpaqueLayer); this.m_OpaqueLayer.Dock = DockStyle.Fill; this.m_OpaqueLayer.BringToFront(); } this.m_OpaqueLayer.Enabled = true; this.m_OpaqueLayer.Visible = true; } catch { } }
private MyOpaqueLayer m_OpaqueLayer = null; //半透明蒙板层 #endregion Fields #region Methods /// <summary> /// 隐藏遮罩层 /// </summary> public void HideOpaqueLayer() { try { if (this.m_OpaqueLayer != null) { this.m_OpaqueLayer.Visible = false; this.m_OpaqueLayer.Enabled = false; m_OpaqueLayer = null; } } catch (Exception) { throw; } finally { } }
/// <summary> /// 隐藏遮罩层 /// </summary> public void HideOpaqueLayer() { try { if (this.m_OpaqueLayer != null) { this.m_OpaqueLayer.Visible = false; this.m_OpaqueLayer.Enabled = false; m_OpaqueLayer = null; } } catch (Exception) { throw; } finally { } }
/// <summary> /// 显示遮罩层 /// </summary> /// <param name="control">控件</param> /// <param name="alpha">透明度</param> /// <param name="isShowLoadingImage">是否显示图标</param> public static void Loading(this Control control, int alpha = 125, bool isShowLoadingImage = true) { try { if (m_OpaqueLayer != null) { m_OpaqueLayer.Parent.Controls.Remove(m_OpaqueLayer); m_OpaqueLayer = null; } if (m_OpaqueLayer == null) { m_OpaqueLayer = new MyOpaqueLayer(alpha, isShowLoadingImage); control.Controls.Add(m_OpaqueLayer); m_OpaqueLayer.Dock = DockStyle.Fill; m_OpaqueLayer.BringToFront(); } m_OpaqueLayer.Enabled = true; m_OpaqueLayer.Visible = true; EnabledTabIndex(control, false); } catch { } }