Source/PopupShadow.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace DevComponents.DotNetBar
{
/// <summary>
/// Summary description for PopupShadow.
/// </summary>
internal class PopupShadow : System.Windows.Forms.Control
{
private bool m_AlphaShadow=true;
public PopupShadow(bool bAlphaShadow)
{
m_AlphaShadow=bAlphaShadow;
this.Visible=false;
this.SuspendLayout();
if(!m_AlphaShadow)
this.BackColor=SystemColors.ControlDark;
//this.ControlBox = false;
//this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
//this.MaximizeBox = false;
//this.MinimizeBox = false;
//this.Opacity = 0.4;
//this.ShowInTaskbar = false;
//this.AutoScale=false;
this.Size=new Size(12,12);
//this.StartPosition=FormStartPosition.Manual;
//this.MinimumSize=new Size(4,4); // This was the key to fix the black box that was showing up for smaller windows
this.SetStyle(ControlStyles.ContainerControl,false);
//this.TopLevel=false;
this.SetStyle(ControlStyles.Selectable,false);
if(m_AlphaShadow)
{
this.SetStyle(ControlStyles.AllPaintingInWmPaint,true);
this.SetStyle(DisplayHelp.DoubleBufferFlag,false);
}
this.ResumeLayout();
}
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
//NativeFunctions.SetLayeredWindowAttributes(this.Handle,Color.Black.ToArgb(),102,NativeFunctions.LWA_ALPHA);
// We want to make the entire bitmap opaque
}
private void PaintShadow()
{
if(this.Width <= 0 || this.Height <= 0) return;
// Create bitmap for drawing onto
Bitmap memoryBitmap = new Bitmap(this.Width, this.Height, PixelFormat.Format32bppArgb);
using(Graphics g = Graphics.FromImage(memoryBitmap))
后面还有 156 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。