我之前用VFP的,可以很隨意建立自己的控件,例如建立一個label控件,定義好字型、字體大小、顏色等屬性,在開發系統的時候就可以調用此label控件,不用每次去設置屬性,在C#中不知如何設置,達到該功能,請大俠指點。
解决方案 »
- 请教各位大神,问题是关于winform获取图片验证码,我设置了cookie,读取验证码的时候也是带着cookie,可以读取到,但是验证时就出错呢?
- 如何查看return 返回值。
- datagridview批量修改单元格值,麻烦来看看,急
- c#编程问题
- shell算法的问题
- 在winform如何用ComboBox做到IE地址栏的功能(自动筛选下拉选项)
- C#里数据类型转换问题?
- 请问一个获取日期问题:我想得到n年第n周的星期n的日期是多少?比如2005年第25周的星期三的日期是??
- c# listview 控件读取文本文档数据
- 请问在WinForm下如何制作“查找”,“查找下一个”,“替换”功能?
- 如何读取文本文件中的每行以“,”分割的数据,并逐行读取???
- 用StreamWriter写文件时,“访问被拒绝”
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing; namespace MaryKay.Library
{
/// <summary>
/// </summary>
[ToolboxData("<{0}:TButton runat=server></{0}:TButton>")]
[ToolboxBitmap(typeof(TButton),"BackLink.bmp")]
public class TButton : Button
{
public TButton()
{
this.Text = "TButton";
this.ToolTip = "Click to go to the previous page";
//.................
}
}
}
[CategoryAttribute("自定义属性")]
[DescriptionAttribute("源列表框标题")]
public string CaptionSource
{
get
{
return this._strCaptionSource;
}
set
{
this._strCaptionSource = value;
this.lblSource.Text = this._strCaptionSource;
}
}
[DescriptionAttribute("为ListBox作数据绑定时发生的事件(暂停用)")]
public event EventHandler SetListSourceEvent;protected void RaiseSetListSourceEvent()
{
if (SetListSourceEvent!=null)
SetListSourceEvent(this,new EventArgs());
}
2、从头开发一个控件,从Control继承或者从UserControl继承
3、如果你不嫌累,还可以从根类继承
如果有,mail一份给我 [email protected] 谢啦