小小飞鹰

     中国人缺少的是步骤,太急。练太极!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2005自定义控件显示基准线

Posted on 2006-10-31 12:54  小小飞鹰  阅读(223)  评论(0编辑  收藏  举报
 
[Designer( typeof( CustomControlDesigner))]
public class CustomControl1: Control
{
 public CustomControl()
 {
 }
 protected override void OnPaint(PaintEventArgs pe)
 {
  pe.Graphics.FillRectangle(new SolidBrush(this.BackColor),pe.ClipRectangle);
  base.onPaint(pe);
 }
 
 public class CustomControlDesigner : ControlDesigner
 {
  public override System.Collections.IList SnapLines
  {
   get
   {
    List<SnapLine> snaplines = new List<SnapLine>();
     snaplines.Add(new SnapLine(SnapLineType.Baseline,3));
    return snaplines;
   }
   }
  }
 }
}