private void UpdateTransparency() { //System.Diagnostics.Debug.WriteLine("UCF UpdateTrans+"); curwindowsborder = (!IsTransparent && defwindowsborder); // we have a border if not transparent and we have a def border bool showtransparent = IsTransparent && !inpanelshow; // are we transparent.. must not be in panel show if (beforetransparency.IsFullyTransparent()) // record colour before transparency, dynamically { beforetransparency = this.BackColor; tkey = this.TransparencyKey; //System.Diagnostics.Debug.WriteLine("Record colour " + beforetransparency.ToString() + " tkey " + this.TransparencyKey); } UpdateControls(); //System.Diagnostics.Debug.WriteLine(Text + " tr " + transparentmode); this.TransparencyKey = (showtransparent) ? transparencycolor : tkey; Color togo = (showtransparent) ? transparencycolor : beforetransparency; this.BackColor = togo; statusStripBottom.BackColor = togo; panel_taskbaricon.BackColor = panel_transparent.BackColor = panel_close.BackColor = panel_minimize.BackColor = panel_ontop.BackColor = panel_showtitle.BackColor = panelTop.BackColor = togo; label_index.ForeColor = labelControlText.ForeColor = showtransparent ? labeltransparentcolour : labelnormalcolour; label_index.TextBackColor = labelControlText.TextBackColor = togo; UserControl.SetTransparency(showtransparent, togo); PerformLayout(); // if in transparent click thru, we set transparent style.. else clear it. BaseUtils.Win32.UnsafeNativeMethods.ChangeWindowLong(this.Handle, BaseUtils.Win32.UnsafeNativeMethods.GWL.ExStyle, WS_EX.TRANSPARENT, showtransparent && transparentmode == TransparencyMode.OnFullyTransparent ? WS_EX.TRANSPARENT : 0); if (showtransparent || inpanelshow) // timer needed if transparent, or if in panel show { timer.Start(); } else { timer.Stop(); } //System.Diagnostics.Debug.WriteLine("UCF UpdateTrans-"); }
private void UpdateTransparency() { curwindowsborder = (!istransparent && defwindowsborder); // we have a border if not transparent and we have a def border bool transparent = istransparent && !inpanelshow; // are we transparent.. Color togo; if (beforetransparency.IsFullyTransparent()) { beforetransparency = this.BackColor; tkey = this.TransparencyKey; } UpdateControls(); this.TransparencyKey = (transparent) ? transparencycolor : tkey; togo = (transparent) ? transparencycolor : beforetransparency; this.BackColor = togo; statusStripBottom.BackColor = togo; panel_taskbaricon.BackColor = panel_transparent.BackColor = panel_close.BackColor = panel_minimize.BackColor = panel_ontop.BackColor = panel_showtitle.BackColor = panelTop.BackColor = togo; System.Diagnostics.Debug.Assert(!labeltransparentcolour.IsFullyTransparent()); label_index.ForeColor = labelControlText.ForeColor = (istransparent) ? labeltransparentcolour : labelnormalcolour; UserControl.SetTransparency(transparent, togo); PerformLayout(); if (transparent || inpanelshow) { timer.Start(); } else { timer.Stop(); } }