登录
首页 » C# » 仿QQ的Menu菜单效果示例源码下载

仿QQ的Menu菜单效果示例源码下载

于 2013-10-02 发布
0 143
下载积分: 1 下载次数: 0

代码说明:

仿QQ的Menu菜单效果示例源码下载

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 恒压供水图纸+PLC程序+组态程序
    (恒压供水plc梯形图程序-接线图)
    2019-04-05下载
    积分:1
  • 传输视频码流方案(MPEG-4)
    采 用UPD 在Internet 上传输 MPEG-4 视频码 流方 案
    2014-11-04下载
    积分:1
  • html网站模板例子源码下载
    html网站模板例子源码下载
    2015-05-13下载
    积分:1
  • 单元测试的艺术(第2版)随书示例源码
    所有程序员都知道应该做单元测试,但为什么你们没有做呢?是因为对单元测试不够了解,还是嫌单元测试麻烦,抑或认为单元测试的投入产出比太低?不管因为什么,你都应该看看这本书。本书在第1版基础上新增了很多内容,不过仍然会手把手地教你从第一个单元测试开始写起,通过简单的例子让你理解如何编写好维护、易明白和可靠的单元测试。在此基础上,本书自然过渡到一些较为高级的主题,比如模拟对象、存根和隔离框架(Moq、FakeItEasy和Typemock Isolator等),同时涉及测试模式,以及组织、重构代码的技巧,乃至怎么测试“不可测试”的代码。另外,其中还介绍了集成测试和关联数据库的测试技术。本书代码示例虽然是用C#写的,但有关单元测试的技术和思想适合所有使用静态类型语言(如VB.NET、Java、C )的测试人员,以及测试驱动开发人员学习借鉴
    2019-02-22下载
    积分:1
  • c#Winform自定义控件
    c#Winform自定义控件-基类控件,按钮,有图标的按钮,选择按钮组,复选框,单选框,进度条,分割线,树,横向列表,列表,分页控件,导航菜单,键盘,文本框,表格,日期控件,Tab页,下拉框,步骤控件,有标题的面板,圆形进度条,面包屑导航,开关等等。using System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using System.Data;using System.Linq;using System.Text;using System.Windows.Forms;namespace HZH_Controls.Controls{    ///     /// Class UCBtnsGroup.    /// Implements the     ///     ///     public partial class UCBtnsGroup : UserControl    {        ///         /// 选中改变事件        ///         [Description("选中改变事件"), Category("自定义")]        public event EventHandler SelectedItemChanged;        ///         /// The m data source        ///         private Dictionary m_dataSource = new Dictionary();        ///         /// 数据源        ///         /// The data source.        [Description("数据源"), Category("自定义")]        public Dictionary DataSource        {            get { return m_dataSource; }            set            {                m_dataSource = value;                Reload();            }        }        ///         /// The m select item        ///         private List m_selectItem = new List();        ///         /// 选中项        ///         /// The select item.        [Description("选中项"), Category("自定义")]        public List SelectItem        {            get { return m_selectItem; }            set            {                m_selectItem = value;                if (m_selectItem == null)                    m_selectItem = new List();                SetSelected();            }        }        ///         /// The m is multiple        ///         private bool m_isMultiple = false;        ///         /// 是否多选        ///         /// true if this instance is multiple; otherwise, false.        [Description("是否多选"), Category("自定义")]        public bool IsMultiple        {            get { return m_isMultiple; }            set { m_isMultiple = value; }        }        ///         /// Initializes a new instance of the class.        ///         public UCBtnsGroup()        {            InitializeComponent();        }        ///         /// Reloads this instance.        ///         private void Reload()        {            try            {                ControlHelper.FreezeControl(flowLayoutPanel1, true);                this.flowLayoutPanel1.Controls.Clear();                if (DataSource != null)                {                    foreach (var item in DataSource)                    {                        UCBtnExt btn = new UCBtnExt();                        btn.BackColor = System.Drawing.Color.Transparent;                        btn.BtnBackColor = System.Drawing.Color.White;                        btn.BtnFont = new System.Drawing.Font("微软雅黑", 10F);                        btn.BtnForeColor = System.Drawing.Color.Gray;                        btn.BtnText = item.Value;                        btn.ConerRadius = 5;                        btn.Cursor = System.Windows.Forms.Cursors.Hand;                        btn.FillColor = System.Drawing.Color.White;                        btn.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);                        btn.IsRadius = true;                        btn.IsShowRect = true;                        btn.IsShowTips = false;                        btn.Location = new System.Drawing.Point(5, 5);                        btn.Margin = new System.Windows.Forms.Padding(5);                        btn.Name = item.Key;                        btn.RectColor = System.Drawing.Color.FromArgb(224, 224, 224);                        btn.RectWidth = 1;                        btn.Size = new System.Drawing.Size(72, 38);                        btn.TabStop = false;                        btn.BtnClick = btn_BtnClick;                        this.flowLayoutPanel1.Controls.Add(btn);                    }                }            }            finally            {                ControlHelper.FreezeControl(flowLayoutPanel1, false);            }            SetSelected();        }        ///         /// Handles the BtnClick event of the btn control.        ///         /// The source of the event.        /// The instance containing the event data.        void btn_BtnClick(object sender, EventArgs e)        {            var btn = sender as UCBtnExt;            if (m_selectItem.Contains(btn.Name))            {                btn.RectColor = System.Drawing.Color.FromArgb(224, 224, 224);                m_selectItem.Remove(btn.Name);            }            else            {                if (!m_isMultiple)                {                    foreach (var item in m_selectItem)                    {                        var lst = this.flowLayoutPanel1.Controls.Find(item, false);                        if (lst.Length == 1)                        {                            var _btn = lst[0] as UCBtnExt;                            _btn.RectColor = System.Drawing.Color.FromArgb(224, 224, 224);                        }                    }                    m_selectItem.Clear();                }                btn.RectColor = System.Drawing.Color.FromArgb(255, 77, 59);                m_selectItem.Add(btn.Name);            }            if (SelectedItemChanged != null)                SelectedItemChanged(this, e);        }        ///         /// Sets the selected.        ///         private void SetSelected()        {            if (m_selectItem != null && m_selectItem.Count > 0 && DataSource != null && DataSource.Count > 0)            {                try                {                    ControlHelper.FreezeControl(flowLayoutPanel1, true);                    if (m_isMultiple)                    {                        foreach (var item in m_selectItem)                        {                            var lst = this.flowLayoutPanel1.Controls.Find(item, false);                            if (lst.Length == 1)                            {                                var btn = lst[0] as UCBtnExt;                                btn.RectColor = System.Drawing.Color.FromArgb(255, 77, 59);                            }                        }                    }                    else                    {                        UCBtnExt btn = null;                        foreach (var item in m_selectItem)                        {                            var lst = this.flowLayoutPanel1.Controls.Find(item, false);                            if (lst.Length == 1)                            {                                btn = lst[0] as UCBtnExt;                                break;                            }                        }                        if (btn != null)                        {                            m_selectItem = new List() { btn.Name };                            btn.RectColor = System.Drawing.Color.FromArgb(255, 77, 59);                        }                    }                }                finally                {                    ControlHelper.FreezeControl(flowLayoutPanel1, false);                }            }        }    }}using System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using System.Data;using System.Linq;using System.Text;using System.Windows.Forms;using System.Drawing.Drawing2D;namespace HZH_Controls.Controls{    ///     /// Class UCStep.    /// Implements the     ///     ///     [DefaultEvent("IndexChecked")]    public partial class UCStep : UserControl    {        ///         /// Occurs when [index checked].        ///         [Description("步骤更改事件"), Category("自定义")]        public event EventHandler IndexChecked;        ///         /// The m step back color        ///         private Color m_stepBackColor = Color.FromArgb(189, 189, 189);        ///         /// 步骤背景色        ///         /// The color of the step back.        [Description("步骤背景色"), Category("自定义")]        public Color StepBackColor        {            get { return m_stepBackColor; }            set            {                m_stepBackColor = value;                Refresh();            }        }        ///         /// The m step fore color        ///         private Color m_stepForeColor = Color.FromArgb(255, 77, 59);        ///         /// 步骤前景色        ///         /// The color of the step fore.        [Description("步骤前景色"), Category("自定义")]        public Color StepForeColor        {            get { return m_stepForeColor; }            set            {                m_stepForeColor = value;                Refresh();            }        }        ///         /// The m step font color        ///         private Color m_stepFontColor = Color.White;        ///         /// 步骤文字颜色        ///         /// The color of the step font.        [Description("步骤文字景色"), Category("自定义")]        public Color StepFontColor        {            get { return m_stepFontColor; }            set            {                m_stepFontColor = value;                Refresh();            }        }        ///         /// The m step width        ///         private int m_stepWidth = 35;        ///         /// 步骤宽度        ///         /// The width of the step.        [Description("步骤宽度景色"), Category("自定义")]        public int StepWidth        {            get { return m_stepWidth; }            set            {                m_stepWidth = value;                Refresh();            }        }        ///         /// The m steps        ///         private string[] m_steps = new string[] { "step1", "step2", "step3" };        ///         /// Gets or sets the steps.        ///         /// The steps.        [Description("步骤"), Category("自定义")]        public string[] Steps        {            get { return m_steps; }            set            {                if (m_steps == null || m_steps.Length Steps.Length)                    return;                m_stepIndex = value;                Refresh();                if (IndexChecked != null)                {                    IndexChecked(this, null);                }            }        }        ///         /// The m line width        ///         private int m_lineWidth = 2;        ///         /// Gets or sets the width of the line.        ///         /// The width of the line.        [Description("连接线宽度,最小2"), Category("自定义")]        public int LineWidth        {            get { return m_lineWidth; }            set            {                if (value < 2)                    return;                m_lineWidth = value;                Refresh();            }        }        ///         /// The m img completed        ///         private Image m_imgCompleted = null;        ///         /// Gets or sets the img completed.        ///         /// The img completed.        [Description("已完成步骤图片,当不为空时,已完成步骤将不再显示数字,建议24*24大小"), Category("自定义")]        public Image ImgCompleted        {            get { return m_imgCompleted; }            set            {                m_imgCompleted = value;                Refresh();            }        }        ///         /// The m LST cache rect        ///         List m_lstCacheRect = new List();        ///         /// Initializes a new instance of the class.        ///         public UCStep()        {            InitializeComponent();            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);            this.SetStyle(ControlStyles.DoubleBuffer, true);            this.SetStyle(ControlStyles.ResizeRedraw, true);            this.SetStyle(ControlStyles.Selectable, true);            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);            this.SetStyle(ControlStyles.UserPaint, true);            this.MouseDown = UCStep_MouseDown;        }        ///         /// Handles the MouseDown event of the UCStep control.        ///         /// The source of the event.        /// The instance containing the event data.        void UCStep_MouseDown(object sender, MouseEventArgs e)        {            var index = m_lstCacheRect.FindIndex(p => p.Contains(e.Location));            if (index >= 0)            {                StepIndex = index 1;            }        }        ///         /// 引发 事件。        ///         /// 包含事件数据的 。        protected override void OnPaint(PaintEventArgs e)        {            base.OnPaint(e);            var g = e.Graphics;            g.SetGDIHigh();            if (m_steps != null && m_steps.Length > 0)            {                System.Drawing.SizeF sizeFirst = g.MeasureString(m_steps[0], this.Font);                int y = (this.Height - m_stepWidth - 10 - (int)sizeFirst.Height) / 2;                if (y < 0)                    y = 0;                int intTxtY = y m_stepWidth 10;                int intLeft = 0;                if (sizeFirst.Width > m_stepWidth)                {                    intLeft = (int)(sizeFirst.Width - m_stepWidth) / 2 1;                }                int intRight = 0;                System.Drawing.SizeF sizeEnd = g.MeasureString(m_steps[m_steps.Length - 1], this.Font);                if (sizeEnd.Width > m_stepWidth)                {                    intRight = (int)(sizeEnd.Width - m_stepWidth) / 2 1;                }                int intSplitWidth = 20;                intSplitWidth = (this.Width - m_steps.Length - (m_steps.Length * m_stepWidth) - intRight - intLeft) / (m_steps.Length - 1);                if (intSplitWidth < 20)                    intSplitWidth = 20;                m_lstCacheRect = new List();                for (int i = 0; i < m_steps.Length; i )                {                    #region 画圆,横线                    Rectangle rectEllipse = new Rectangle(new Point(intLeft i * (m_stepWidth intSplitWidth), y), new Size(m_stepWidth, m_stepWidth));                    m_lstCacheRect.Add(rectEllipse);                    g.FillEllipse(new SolidBrush(m_stepBackColor), rectEllipse);                    if (m_stepIndex > i)                    {                        g.FillEllipse(new SolidBrush(m_stepForeColor), new Rectangle(new Point(intLeft i * (m_stepWidth intSplitWidth) 2, y 2), new Size(m_stepWidth - 4, m_stepWidth - 4)));                    }                    if (m_stepIndex > i && m_imgCompleted != null)                    {                        g.DrawImage(m_imgCompleted, new Rectangle(new Point((intLeft i * (m_stepWidth intSplitWidth) (m_stepWidth - 24) / 2), y (m_stepWidth - 24) / 2), new Size(24, 24)), 0, 0, m_imgCompleted.Width, m_imgCompleted.Height, GraphicsUnit.Pixel, null);                    }                    else                    {                        System.Drawing.SizeF _numSize = g.MeasureString((i 1).ToString(), this.Font);                        g.DrawString((i 1).ToString(), Font, new SolidBrush(m_stepFontColor), new Point(intLeft i * (m_stepWidth intSplitWidth) (m_stepWidth - (int)_numSize.Width) / 2 1, y (m_stepWidth - (int)_numSize.Height) / 2 1));                    }                    #endregion                    System.Drawing.SizeF sizeTxt = g.MeasureString(m_steps[i], this.Font);                    g.DrawString(m_steps[i], Font, new SolidBrush(m_stepIndex > i ? m_stepForeColor : m_stepBackColor), new Point(intLeft i * (m_stepWidth intSplitWidth) (m_stepWidth - (int)sizeTxt.Width) / 2 1, intTxtY));                }                for (int i = 0; i < m_steps.Length; i )                {                    if (m_stepIndex > i)                    {                        if (i != m_steps.Length - 1)                        {                            if (m_stepIndex == i 1)                            {                                g.DrawLine(new Pen(m_stepForeColor, m_lineWidth), new Point(intLeft i * (m_stepWidth intSplitWidth) m_stepWidth - 3, y ((m_stepWidth) / 2)), new Point(intLeft i * (m_stepWidth intSplitWidth) m_stepWidth intSplitWidth / 2, y ((m_stepWidth) / 2)));                                g.DrawLine(new Pen(m_stepBackColor, m_lineWidth), new Point(intLeft i * (m_stepWidth intSplitWidth) m_stepWidth intSplitWidth / 2, y ((m_stepWidth) / 2)), new Point(intLeft (i 1) * (m_stepWidth intSplitWidth) 10, y ((m_stepWidth) / 2)));                            }                            else                            {                                g.DrawLine(new Pen(m_stepForeColor, m_lineWidth), new Point(intLeft i * (m_stepWidth intSplitWidth) m_stepWidth - 3, y ((m_stepWidth) / 2)), new Point(intLeft (i 1) * (m_stepWidth intSplitWidth) 10, y ((m_stepWidth) / 2)));                            }                        }                    }                    else                    {                        if (i != m_steps.Length - 1)                        {                            g.DrawLine(new Pen(m_stepBackColor, m_lineWidth), new Point(intLeft i * (m_stepWidth intSplitWidth) m_stepWidth - 3, y ((m_stepWidth) / 2)), new Point(intLeft (i 1) * (m_stepWidth intSplitWidth) 10, y ((m_stepWidth) / 2)));                        }                    }                }            }        }    }}
    2020-12-11下载
    积分:1
  • C# 自定义OpenFileDialog 实例源码下载
    自定义OpenFileDialog
    2013-10-03下载
    积分:1
  • IOC框架Ninject实践例子
    该实例在 客户端应用、mvc中,xml配置、手动配置 等多种形式 介绍了 Ninject的用法
    2015-06-09下载
    积分:1
  • UI缩放功能实现
    【实例简介】UI缩放功能实现 根据不同分辨率,控件能够自动缩放
    2021-11-30 00:45:50下载
    积分:1
  • GC 垃圾回收算法
      =1,2垃圾回收算法:    托管堆:CLR要求的资源从托管堆分配,任何对象只要没有应用程序的根引用它,都会在某个时刻被垃圾回收器回收 基于代的机制,提高回收的性能,在程序的生命期中,新建的对象是新一代,而创建的比较早的对象是老一代,第0代是最近分配的对象,CLR 使用了0,1,2三代进行管理 =3 GC和调试GcAndDebug.cs =4本地资源终结(finalization)是CLR提供的一种机制,允许对象在垃圾回收器回收其内存之前执行一些得体的清理工作,任何包装了本地资源的类型都必须支持终结操作(实现一个命名为Finalize的方法)。GC判断一个对象是垃圾时,会调用对象的Finalize(实现的情况下),C#中使用~ClassName表示FinalizeIn most cases, you do not need to write classes that derive from the CriticalFinalizerObject class. The .NET Framework class library provides two classes, SafeHandle and CriticalHandle, that provide critical finalization functionality for handle resources. Furthermore, the .NET Framework provides a set of prewritten classes derived from the SafeHandle class, and this set is located in the Microsoft.Win32.SafeHandles namespace. These classes are designed to provide common functionality for supporting file and operating system handles. System.Runtime.ConstrainedExecution 下的 CriticalFinalizerObject 抽象对象,CLR特殊对待 System.Runtime.InteropServices下的派生抽象类 SafeHandle CriticalHandle 和SafeHandle只是引用计数的区别Microsoft.Win32.SafeHandles  SafeFileHandle,SafeRegistryHandle ,SafeWaitHandle... SafeProcessHandle SafeLibraryHandle SafeLocalMemHandle SafeThreadHandle等MSDN没有编写,但同样是处理这个问题的 类似的实现的不同类代表不同的资源类型,这么多的类似,主要是为了类型安全SafeHandle的作用:1、以前的IntPtr形式不够健壮,如在IntPtr赋值前可能抛出ThreadAbortException异常,这样托管代码将造成本地资源的泄露2、防止利用潜在的安全漏洞,一个线程访问一个本地资源,另一个线程释放该资源,通过引用计数实现 对托管资源只有在极少数情况下才使用终结器 终结器被调用的时刻:1、第0代满:2、显式调用GC.Collect3、Windows报告内存不足4、CLR卸载AppDomain5、CLR关闭 内部实现使用终结列表保留对象,通过这个GC进行处理, freachable队列 =Dispose终结器的调用时间由GC确定,调用者无法显式调用它Dispose提供了显式清理资源的能力 GCHandle WeakReference System.Runtime.CompilerServices.ConditionalWeakTable 加入时的是对象的WeakReference,因此可能会回收,但可以确保只要key存在,value也是存在的 任何大于85000字节的对象被自动认为是大对象,大对象在大对象堆中分配 ==大量资源GCpublic static void AddMemoryPressure(Int64 bytesAllocated);   public static void RemoveMemoryPressure(Int64 bytesAllocated);提示GC实际需要消耗的内存,然后GC监视内存压力,压力变大时,强制回收 System.Runtime.InteropServices  HandleCollector 数量有限的本地资源 MemoryFailPoint在需要大量内存前可以先检查是否可以使用这么大的内存 GC的监视代码形式: GC.GetTotalMemory GC.CollectionCountPerMon.exe系统性能监视工具CLR Profiler工具FUSLOGVW.execlrver.exeSvcTraceViewer.exe
    2012-12-16下载
    积分:1
  • C# 汉字转拼音比较全的类(支持大部分汉字) 源码下载
    C# 汉字转拼音比较全的类(支持大部分汉字) 源码下载
    2013-12-12下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载