/// <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._opaqueLayer == null) { this._opaqueLayer = new OpaqueLayer(alpha, isShowLoadingImage); control.Controls.Add(this._opaqueLayer); this._opaqueLayer.Dock = DockStyle.Fill; this._opaqueLayer.BringToFront(); } else { control.Controls.Add(this._opaqueLayer); } this._opaqueLayer.Enabled = true; this._opaqueLayer.Visible = true; } catch { } }
private OpaqueLayer _opaqueLayer = null; //半透明蒙板层 #endregion Fields #region Constructors public OpaqueCommand(int alpha, bool isShowLoadingImage, Color color) { this._opaqueLayer = new OpaqueLayer(alpha, isShowLoadingImage,color); }