写组件时需要的注释与属性书写方法
2006-11-02 13:12
363 查看
using System;
using System.ComponentModel;
using System.Collections;
using System.Diagnostics;
namespace WindowsApplication1
...{
/**////
/// Component1 的摘要说明。
///
///
给组件加图标的三种方法#region 给组件加图标的三种方法
/**//*
// Specifies the bitmap associated with the Button type.
[ToolboxBitmap(@"C:Documents and SettingsJoeMyPicsmyImage.bmp")]
// Specifies the bitmap associated with the Button type.
[ToolboxBitmap(typeof(Button))]
// Specifies a type that indicates the assembly to search, and the name
// of an image resource to look for.
[ToolboxBitmap(typeof(MyControl), "MyControlBitmap")]
*/
#endregion
public class MyComponent1 : System.ComponentModel.Component
...{
/**////
/// 必需的设计器变量。
///
private System.ComponentModel.Container components = null;
/**//// test is a method in the MyClass class.
///
public string test()
...{
return "方法的注解";
}
/**////
Used to indicate status.
public string test1(int Int1)
...{
return "参数的注解";
}
private string FField="属性框里的描述!";
[Description("The image associated with the control")]
public string Field
...{
/**////
/// 我的测试类
///
get...{return FField;}
set...{}
}
private string FField1="属性框里的种类!";
[Category("Appearance")]
public string Field1
...{
/**////
/// 我的测试类
///
get...{return FField1;}
set...{}
}
public MyComponent1(System.ComponentModel.IContainer container)
...{
/**////
/// Windows.Forms 类撰写设计器支持所必需的
///
container.Add(this);
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
public MyComponent1()
...{
/**////
/// Windows.Forms 类撰写设计器支持所必需的
///
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/**////
/// 清理所有正在使用的资源。
///
protected override void Dispose( bool disposing )
...{
if( disposing )
...{
if(components != null)
...{
components.Dispose();
}
}
base.Dispose( disposing );
}
组件设计器生成的代码#region 组件设计器生成的代码
/**////
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
///
private void InitializeComponent()
...{
components = new System.ComponentModel.Container(); } #endregion }}
相关文章推荐
- 写组件时需要的注释与属性书写方法
- [导入]写组件时需要的注释与属性书写方法
- 两种方法调用Bootstrap3的Javascript组件:data属性定义和书写JS代码
- jquery easyui中获取各组件属性的方法
- 举例说明android进行初始化组件并设置组件属性的简便方法
- 说说Android 两种为自定义组件添加属性的使用方法和区别
- 当使用EasyUI时,需要的Field属性是子属性时候,除了formatter和修改jquery.easyui.min.js的方法
- 父组件中调用子组件的方法和属性
- 我自己的方法、组件、属性、变量、常量、数据库常用操作命名方法。
- EXT 组件一些属性与方法(Tree)
- flash builder中SKINCLASS绑定自定义组件属性方法
- jmail组件 对象不支持此属性或方法: 'JMail.ServerAddress' 的解决办法
- ExtJS4组件_form表单配置-属性-方法详解
- Microsoft.XMLHttp组件的属性方法
- 表格组件列属性formatter和styler使用方法
- EXT 组件一些属性与方法(panel)
- ASP中FSO组件的属性和方法(四)-
- 只安装自己需要的Office2016组件的方法
- Flash AS3中调试组件时出错------无法访问空对象引用的属性或方法。
- 说说Android 两种为自定义组件添加属性的使用方法和区别