官网

http://www.hzhcontrols.com

前提

入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章。

GitHub:https://github.com/kwwwvagaa/NetWinformControl

码云:https://gitee.com/kwwwvagaa/net_winform_custom_control.git

如果觉得写的还行,请点个 star 支持一下吧

欢迎前来交流探讨: 企鹅群568015492 

idkey=6e08741ef16fe53bf0314c1c9e336c4f626047943a8b76bac062361bab6b4f8d">

目录

https://www.cnblogs.com/bfyx/p/11364884.html

准备工作

GDI+需要有一点了解,不知道的可以百度瞅瞅

开始

添加一个用户控件,命名UCSwitch

添加一个枚举用以控制样式

 public enum SwitchType
{
/// <summary>
/// 椭圆
/// </summary>
Ellipse,
/// <summary>
/// 四边形
/// </summary>
Quadrilateral,
/// <summary>
/// 横线
/// </summary>
Line
}

添加属性

   [Description("选中改变事件"), Category("自定义")]
public event EventHandler CheckedChanged;
private Color m_trueColor = Color.FromArgb(, , ); [Description("选中时颜色"), Category("自定义")]
public Color TrueColor
{
get { return m_trueColor; }
set
{
m_trueColor = value;
Refresh();
}
} private Color m_falseColor = Color.FromArgb(, , ); [Description("没有选中时颜色"), Category("自定义")]
public Color FalseColor
{
get { return m_falseColor; }
set
{
m_falseColor = value;
Refresh();
}
} private bool m_checked; [Description("是否选中"), Category("自定义")]
public bool Checked
{
get { return m_checked; }
set
{
m_checked = value;
Refresh();
if (CheckedChanged != null)
{
CheckedChanged(this, null);
}
}
} private string[] m_texts; [Description("文本值,当选中或没有选中时显示,必须是长度为2的数组"), Category("自定义")]
public string[] Texts
{
get { return m_texts; }
set
{
m_texts = value;
Refresh();
}
}
private SwitchType m_switchType = SwitchType.Ellipse; [Description("显示类型"), Category("自定义")]
public SwitchType SwitchType
{
get { return m_switchType; }
set
{
m_switchType = value;
Refresh();
}
} public override Font Font
{
get
{
return base.Font;
}
set
{
base.Font = value;
Refresh();
}
}

重绘

  protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
var g = e.Graphics;
g.SetGDIHigh();
if (m_switchType == HZH_Controls.Controls.SwitchType.Ellipse)
{
var fillColor = m_checked ? m_trueColor : m_falseColor;
GraphicsPath path = new GraphicsPath();
path.AddLine(new Point(this.Height / , ), new Point(this.Width - this.Height / , ));
path.AddArc(new Rectangle(this.Width - this.Height - , , this.Height - , this.Height - ), -, );
path.AddLine(new Point(this.Width - this.Height / , this.Height - ), new Point(this.Height / , this.Height - ));
path.AddArc(new Rectangle(, , this.Height - , this.Height - ), , );
g.FillPath(new SolidBrush(fillColor), path); string strText = string.Empty;
if (m_texts != null && m_texts.Length == )
{
if (m_checked)
{
strText = m_texts[];
}
else
{
strText = m_texts[];
}
} if (m_checked)
{
g.FillEllipse(Brushes.White, new Rectangle(this.Width - this.Height - + , + , this.Height - - , this.Height - - ));
if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle((this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point((this.Height - - ) / , intTextY));
}
}
else
{
g.FillEllipse(Brushes.White, new Rectangle( + , + , this.Height - - , this.Height - - ));
if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / - (int)sizeF.Width / , intTextY));
}
}
}
else if (m_switchType == HZH_Controls.Controls.SwitchType.Quadrilateral)
{
var fillColor = m_checked ? m_trueColor : m_falseColor;
GraphicsPath path = new GraphicsPath();
int intRadius = ;
path.AddArc(, , intRadius, intRadius, 180f, 90f);
path.AddArc(this.Width - intRadius - , , intRadius, intRadius, 270f, 90f);
path.AddArc(this.Width - intRadius - , this.Height - intRadius - , intRadius, intRadius, 0f, 90f);
path.AddArc(, this.Height - intRadius - , intRadius, intRadius, 90f, 90f); g.FillPath(new SolidBrush(fillColor), path); string strText = string.Empty;
if (m_texts != null && m_texts.Length == )
{
if (m_checked)
{
strText = m_texts[];
}
else
{
strText = m_texts[];
}
} if (m_checked)
{
GraphicsPath path2 = new GraphicsPath();
path2.AddArc(this.Width - this.Height - + , + , intRadius, intRadius, 180f, 90f);
path2.AddArc(this.Width - - - intRadius, + , intRadius, intRadius, 270f, 90f);
path2.AddArc(this.Width - - - intRadius, this.Height - - intRadius - , intRadius, intRadius, 0f, 90f);
path2.AddArc(this.Width - this.Height - + , this.Height - - intRadius - , intRadius, intRadius, 90f, 90f);
g.FillPath(Brushes.White, path2); if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle((this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point((this.Height - - ) / , intTextY));
}
}
else
{
GraphicsPath path2 = new GraphicsPath();
path2.AddArc( + , + , intRadius, intRadius, 180f, 90f);
path2.AddArc(this.Height - - intRadius, + , intRadius, intRadius, 270f, 90f);
path2.AddArc(this.Height - - intRadius, this.Height - - intRadius - , intRadius, intRadius, 0f, 90f);
path2.AddArc( + , this.Height - - intRadius - , intRadius, intRadius, 90f, 90f);
g.FillPath(Brushes.White, path2); //g.FillEllipse(Brushes.White, new Rectangle(1 + 2, 1 + 2, this.Height - 2 - 4, this.Height - 2 - 4));
if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / - (int)sizeF.Width / , intTextY));
}
}
}
else
{
var fillColor = m_checked ? m_trueColor : m_falseColor;
int intLineHeight = (this.Height - - ) / ; GraphicsPath path = new GraphicsPath();
path.AddLine(new Point(this.Height / , (this.Height - intLineHeight) / ), new Point(this.Width - this.Height / , (this.Height - intLineHeight) / ));
path.AddArc(new Rectangle(this.Width - this.Height / - intLineHeight - , (this.Height - intLineHeight) / , intLineHeight, intLineHeight), -, );
path.AddLine(new Point(this.Width - this.Height / , (this.Height - intLineHeight) / + intLineHeight), new Point(this.Width - this.Height / , (this.Height - intLineHeight) / + intLineHeight));
path.AddArc(new Rectangle(this.Height / , (this.Height - intLineHeight) / , intLineHeight, intLineHeight), , );
g.FillPath(new SolidBrush(fillColor), path); if (m_checked)
{
g.FillEllipse(new SolidBrush(fillColor), new Rectangle(this.Width - this.Height - + , + , this.Height - - , this.Height - - ));
g.FillEllipse(Brushes.White, new Rectangle(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / - , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
g.FillEllipse(new SolidBrush(fillColor), new Rectangle( + , + , this.Height - - , this.Height - - ));
g.FillEllipse(Brushes.White, new Rectangle((this.Height - - ) / - ((this.Height - - ) / ) / + , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
}
}

处理一下点击事件

  void UCSwitch_MouseDown(object sender, MouseEventArgs e)
{
Checked = !Checked;
}

完整代码

 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
{
[DefaultEvent("CheckedChanged")]
public partial class UCSwitch : UserControl
{
[Description("选中改变事件"), Category("自定义")]
public event EventHandler CheckedChanged;
private Color m_trueColor = Color.FromArgb(, , ); [Description("选中时颜色"), Category("自定义")]
public Color TrueColor
{
get { return m_trueColor; }
set
{
m_trueColor = value;
Refresh();
}
} private Color m_falseColor = Color.FromArgb(, , ); [Description("没有选中时颜色"), Category("自定义")]
public Color FalseColor
{
get { return m_falseColor; }
set
{
m_falseColor = value;
Refresh();
}
} private bool m_checked; [Description("是否选中"), Category("自定义")]
public bool Checked
{
get { return m_checked; }
set
{
m_checked = value;
Refresh();
if (CheckedChanged != null)
{
CheckedChanged(this, null);
}
}
} private string[] m_texts; [Description("文本值,当选中或没有选中时显示,必须是长度为2的数组"), Category("自定义")]
public string[] Texts
{
get { return m_texts; }
set
{
m_texts = value;
Refresh();
}
}
private SwitchType m_switchType = SwitchType.Ellipse; [Description("显示类型"), Category("自定义")]
public SwitchType SwitchType
{
get { return m_switchType; }
set
{
m_switchType = value;
Refresh();
}
} public override Font Font
{
get
{
return base.Font;
}
set
{
base.Font = value;
Refresh();
}
} public UCSwitch()
{
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 += UCSwitch_MouseDown;
} void UCSwitch_MouseDown(object sender, MouseEventArgs e)
{
Checked = !Checked;
} protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
var g = e.Graphics;
g.SetGDIHigh();
if (m_switchType == HZH_Controls.Controls.SwitchType.Ellipse)
{
var fillColor = m_checked ? m_trueColor : m_falseColor;
GraphicsPath path = new GraphicsPath();
path.AddLine(new Point(this.Height / , ), new Point(this.Width - this.Height / , ));
path.AddArc(new Rectangle(this.Width - this.Height - , , this.Height - , this.Height - ), -, );
path.AddLine(new Point(this.Width - this.Height / , this.Height - ), new Point(this.Height / , this.Height - ));
path.AddArc(new Rectangle(, , this.Height - , this.Height - ), , );
g.FillPath(new SolidBrush(fillColor), path); string strText = string.Empty;
if (m_texts != null && m_texts.Length == )
{
if (m_checked)
{
strText = m_texts[];
}
else
{
strText = m_texts[];
}
} if (m_checked)
{
g.FillEllipse(Brushes.White, new Rectangle(this.Width - this.Height - + , + , this.Height - - , this.Height - - ));
if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle((this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point((this.Height - - ) / , intTextY));
}
}
else
{
g.FillEllipse(Brushes.White, new Rectangle( + , + , this.Height - - , this.Height - - ));
if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / - (int)sizeF.Width / , intTextY));
}
}
}
else if (m_switchType == HZH_Controls.Controls.SwitchType.Quadrilateral)
{
var fillColor = m_checked ? m_trueColor : m_falseColor;
GraphicsPath path = new GraphicsPath();
int intRadius = ;
path.AddArc(, , intRadius, intRadius, 180f, 90f);
path.AddArc(this.Width - intRadius - , , intRadius, intRadius, 270f, 90f);
path.AddArc(this.Width - intRadius - , this.Height - intRadius - , intRadius, intRadius, 0f, 90f);
path.AddArc(, this.Height - intRadius - , intRadius, intRadius, 90f, 90f); g.FillPath(new SolidBrush(fillColor), path); string strText = string.Empty;
if (m_texts != null && m_texts.Length == )
{
if (m_checked)
{
strText = m_texts[];
}
else
{
strText = m_texts[];
}
} if (m_checked)
{
GraphicsPath path2 = new GraphicsPath();
path2.AddArc(this.Width - this.Height - + , + , intRadius, intRadius, 180f, 90f);
path2.AddArc(this.Width - - - intRadius, + , intRadius, intRadius, 270f, 90f);
path2.AddArc(this.Width - - - intRadius, this.Height - - intRadius - , intRadius, intRadius, 0f, 90f);
path2.AddArc(this.Width - this.Height - + , this.Height - - intRadius - , intRadius, intRadius, 90f, 90f);
g.FillPath(Brushes.White, path2); if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle((this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point((this.Height - - ) / , intTextY));
}
}
else
{
GraphicsPath path2 = new GraphicsPath();
path2.AddArc( + , + , intRadius, intRadius, 180f, 90f);
path2.AddArc(this.Height - - intRadius, + , intRadius, intRadius, 270f, 90f);
path2.AddArc(this.Height - - intRadius, this.Height - - intRadius - , intRadius, intRadius, 0f, 90f);
path2.AddArc( + , this.Height - - intRadius - , intRadius, intRadius, 90f, 90f);
g.FillPath(Brushes.White, path2); //g.FillEllipse(Brushes.White, new Rectangle(1 + 2, 1 + 2, this.Height - 2 - 4, this.Height - 2 - 4));
if (string.IsNullOrEmpty(strText))
{
g.DrawEllipse(new Pen(Color.White, ), new Rectangle(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
System.Drawing.SizeF sizeF = g.MeasureString(strText.Replace(" ", "A"), Font);
int intTextY = (this.Height - (int)sizeF.Height) / + ;
g.DrawString(strText, Font, Brushes.White, new Point(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / - (int)sizeF.Width / , intTextY));
}
}
}
else
{
var fillColor = m_checked ? m_trueColor : m_falseColor;
int intLineHeight = (this.Height - - ) / ; GraphicsPath path = new GraphicsPath();
path.AddLine(new Point(this.Height / , (this.Height - intLineHeight) / ), new Point(this.Width - this.Height / , (this.Height - intLineHeight) / ));
path.AddArc(new Rectangle(this.Width - this.Height / - intLineHeight - , (this.Height - intLineHeight) / , intLineHeight, intLineHeight), -, );
path.AddLine(new Point(this.Width - this.Height / , (this.Height - intLineHeight) / + intLineHeight), new Point(this.Width - this.Height / , (this.Height - intLineHeight) / + intLineHeight));
path.AddArc(new Rectangle(this.Height / , (this.Height - intLineHeight) / , intLineHeight, intLineHeight), , );
g.FillPath(new SolidBrush(fillColor), path); if (m_checked)
{
g.FillEllipse(new SolidBrush(fillColor), new Rectangle(this.Width - this.Height - + , + , this.Height - - , this.Height - - ));
g.FillEllipse(Brushes.White, new Rectangle(this.Width - - (this.Height - - ) / - ((this.Height - - ) / ) / - , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
else
{
g.FillEllipse(new SolidBrush(fillColor), new Rectangle( + , + , this.Height - - , this.Height - - ));
g.FillEllipse(Brushes.White, new Rectangle((this.Height - - ) / - ((this.Height - - ) / ) / + , (this.Height - - (this.Height - - ) / ) / + , (this.Height - - ) / , (this.Height - - ) / ));
}
}
} } public enum SwitchType
{
/// <summary>
/// 椭圆
/// </summary>
Ellipse,
/// <summary>
/// 四边形
/// </summary>
Quadrilateral,
/// <summary>
/// 横线
/// </summary>
Line
}
}
 namespace HZH_Controls.Controls
{
partial class UCSwitch
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} #region 组件设计器生成的代码 /// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// UCSwitch
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Transparent;
this.Name = "UCSwitch";
this.Size = new System.Drawing.Size(, );
this.ResumeLayout(false); } #endregion
}
}

用处及效果

最后的话

如果你喜欢的话,请到 https://gitee.com/kwwwvagaa/net_winform_custom_control 点个星 星吧

(四十)c#Winform自定义控件-开关-HZHControls的更多相关文章

  1. (四十四)c#Winform自定义控件-水波-HZHControls

    官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...

  2. (二十四)c#Winform自定义控件-单标题窗体

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...

  3. (四)c#Winform自定义控件-选择按钮组

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...

  4. (十四)c#Winform自定义控件-键盘(一)

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...

  5. (五十四)c#Winform自定义控件-仪表盘

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...

  6. (六十四)c#Winform自定义控件-温度计(工业)

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...

  7. (七十四)c#Winform自定义控件-金字塔图表

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...

  8. (八十四)c#Winform自定义控件-导航菜单(类Office菜单)

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...

  9. (四十六)c#Winform自定义控件-水波进度条-HZHControls

    官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...

随机推荐

  1. NLP标注工具brat 配置文件说明

    快速搭建brat 通过docker: docker run --name=brat -d -p 38080:80 -e BRAT_USERNAME=brat -e BRAT_PASSWORD=brat ...

  2. jQuery实现电梯导航特效

    功能描述: 当滚动条滑到某个位置时,显示电梯导航: 当用户滚动滚动条时,让电梯导航的选中状态和当前滚动到的区域保持一致: 当用户点击电梯导航时,滚动条滚动到被点击导航对应的区域 准备工作: 首先将jQ ...

  3. HTML连载57-相对定位和绝对定位

    一.定位流 1.分类 (1)相对定位: (2)绝对定位 (3)固定定位 (4)静态定位 2.什么相对定位 相对定位就是相对于自己以前在标准流中的位置来移动. 例子: <style> div ...

  4. 关于EXIT和BADI增强的查找

    EXIT出口的查找: 方法一: 第一步:通过SE30,输入TCODE(例如ME21N),执行EXCUTE,前台创建一张采购订单.点击TIMES页签,查找EXIT开头的SAP程序.  第二步:这些fun ...

  5. 「SAP技术」SAP MM 明明有维护源清单,还是不能下PO?

    SAP MM 明明有维护源清单,还是不能下PO? 下午收到用户报错说,创建采购订单失败,报错 :Material ### not included in source list despite sou ...

  6. iOS WKWebView与JS的交互

    参考链接:https://www.jianshu.com/p/524bc8699ac2

  7. Android 插件化开发(一):Java 反射技术介绍

    写在前面:学习插件化开发推荐书籍<Android 插件化开发指南>,本系列博客所整理知识部分内容出自此书. 在之前的项目架构的博文中,我们提到了项目插件化架构,提到插件化架构不得不提的到J ...

  8. DDMS files not found: xxx\hprof-conv.exe

    出现如下错误: DDMS files not found: xxx\hprof-conv.exe The connection to adb is down, and a severe error h ...

  9. 精通awk系列(13):print、printf、sprintf和重定向

    回到: Linux系列文章 Shell系列文章 Awk系列文章 输出操作 awk可以通过print.printf将数据输出到标准输出或重定向到文件. print print elem1,elem2,e ...

  10. Pycharm导入Django项目

    Pycharm导入Django项目 添加项目:file-->open,找到项目所在的位置打开项目 添加django后台项目路径 file-->settings-->Languages ...