自定义控件的学习日志(Pro.NET2.0 Windows Forms and Custom Controls)
来源:互联网 发布:链轮计算软件 编辑:程序博客网 时间:2024/05/22 07:48
控件设计时鼠标的控制
- ControlDesigner.OnPaintAdornments,在控件设计时可以在控件上进行绘制,如下代码所示,当控件在设计时鼠标移入则在控件上画一矩形边框
private bool mouseOver;
protected override void OnMouseEnter()
{
base.OnMouseEnter();
mouseOver = true;
Control.Invalidate();
}
protected override void OnMouseLeave()
{
base.OnMouseLeave();
mouseOver = false;
Control.Invalidate();
}
protected override void OnPaintAdornments(System.Windows.Forms.PaintEventArgs pe)
{
base.OnPaintAdornments(pe);
if (mouseOver)
{
pe.Graphics.DrawRectangle(pen, 0, 0, Control.Width - 1, Control.Height - 1);
}
}
2.ControlDesigner.SelectionRules用于控制控件在设计是是否可以改变大小等,如下代码:
public override System.Windows.Forms.Design.SelectionRules SelectionRules
{
get
{
return System.Windows.Forms.Design.SelectionRules.LeftSizeable | System.Windows.Forms.Design.SelectionRules.Moveable;
}
}
含义为控件是设计时可以从左侧改变大小,并且是可移动的
- 自定义控件的学习日志(Pro.NET2.0 Windows Forms and Custom Controls)
- Pro .NET 2.0 Windows Forms and Custom Controls in C#
- Pro .NET 2.0 Windows Forms and Custom Controls in C#
- Pro .NET 2.0 Windows Forms and Custom Controls in VB 2005
- Custom Controls——自定义控件
- User controls and custom controls
- Custom Controls and User Controls
- Forms Controls and ActiveX Controls in Excel
- "Ascend.Net" Windows Forms Controls
- custom control的使用方法(Creating and Using custom controls in VC++)
- vici mvc开发第九篇——Custom Controls(自定义控件)
- net2.0自定义注册控件
- How to: Host Controls in Windows Forms DataGridView Cells(介绍如何在datagridview中自定义列)
- 自定义MembershipProvider,asp.net2.0 Forms验证-代码及分析
- Using Windows Forms Controls in Internet Explorer
- Using Windows Forms Controls in Internet Explorer
- Using Windows Forms Controls in Internet Explorer
- Using Windows Forms Controls in Internet Explorer
- 2007年第三季度正常客户星级
- 查询短信
- 营销平台虚拟数据添加
- Java Lucene(7):编写索引器之二
- CSS多级下拉菜单
- 自定义控件的学习日志(Pro.NET2.0 Windows Forms and Custom Controls)
- 关于百度IM的几个看法
- 基于Lucene/XML的站内全文检索解决方案:WebLucene
- JavaScript函数小集锦
- AWStats简介:Apache/IIS的日志分析工具
- Issue 111( Most important discoveries or creation are accidental; it is usually while seeking the answer to one question that
- API SDK MFC 的比较
- LAMP环境安装简介(php+mysql)
- 流媒体视频播放代码总结。