Source/Ribbon/KeyTipsCanvasControl.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace DevComponents.DotNetBar
{
/// <summary>
/// Represents canvas for KeyTips
/// </summary>
internal class KeyTipsCanvasControl : Control
{
#region Private variables
private Control m_ParentControl=null;
private IKeyTipsRenderer m_Renderer=null;
#endregion
#region Internal Implementation
public KeyTipsCanvasControl(IKeyTipsRenderer renderer)
{
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.Opaque, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.SetStyle(ControlStyles.ContainerControl, false);
this.SetStyle(ControlStyles.Selectable, false);
this.BackColor = Color.Transparent;
m_Renderer = renderer;
}
protected override void Dispose(bool disposing)
{
if (m_ParentControl != null)
{
m_ParentControl.Resize -= new EventHandler(ParentControlResize);
m_ParentControl = null;
}
base.Dispose(disposing);
}
protected override void OnPaint(PaintEventArgs e)
{
if (m_Renderer != null)
{
m_Renderer.PaintKeyTips(e.Graphics);
}
base.OnPaint(e);
}
protected override void OnParentChanged(EventArgs e)
{
if (m_ParentControl != null)
m_ParentControl.Resize -= new EventHandler(ParentControlResize);
m_ParentControl = this.Parent;
if(m_ParentControl!=null)
m_ParentControl.Resize += new EventHandler(ParentControlResize);
后面还有 51 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。