WinForm中自定义文本框中怎么绘制图形?比如一条直线.
有解出再加50分,谢~~~~~~~~~~~~~~~~
有解出再加50分,谢~~~~~~~~~~~~~~~~
解决方案 »
- 关于c#中datagridview的绑定问题
- 又软软键盘弹出的问题
- |ZYCWPF| 自动百度回贴已经可以,但网页会提示Active控件,帮看看写法是否科学?如何更好的进行实现?谢谢 有示例源码
- C#窗体间的传值?
- c#调用以前的Dll问题,请前辈帮小弟看下代码,小弟先感谢了!
- 100分请教C#如何清理IE缓存
- C#如何遍历网站中每个页面地址
- 谁帮我用中文件注解方式帮我分析下下面的代码,是获取指定网页文本框内容的代码..
- 与 VB 中的“On Error Resume Next”相同的是???
- 请问哪位大虾知道后缀名为.rmp的文件如何下载下来?急,在线等待,马上给分
- 控制台的托盘程序如何在关闭控制台时把托盘图标去掉。在线等,急
- 求一正则表达式!!! 将文本框中用 [ ] 中的字符取出.
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;namespace contro_lset
{
/// <summary>
/// mybutton 的摘要说明。
/// </summary>
public class mybutton : System.Windows.Forms.TextBox
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public mybutton()
{
// 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent();
this.Width=100;
this.Height=75;
MouseEnter+=new EventHandler(OnMouseEnter);
// TODO: 在 InitComponent 调用后添加任何初始化
} /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if( components != null )
components.Dispose();
}
base.Dispose( disposing );
} #region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion protected override void OnPaint(PaintEventArgs pe)
{
pe.Graphics.DrawLine(new Pen(Color.Blue),0,4,80,5);
}
private void OnMouseEnter(object o,System.EventArgs e)
{
OnPaint(new PaintEventArgs(this.CreateGraphics(),this.ClientRectangle)); }
}
}