zoukankan
html css js c++ java
c#,winform,UserContrl,用户控件开发,窗体 Virus
用户控件效果如上图
代码如下:
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Drawing;
using
System.Data;
using
System.Text;
using
System.Windows.Forms;
namespace
WindowsControlLibrary1
{
public
partial
class
UserControl1 : UserControl
{
public
event
EventHandler AddressLine1Changed;
public
event
EventHandler AddressLine2Changed;
public
event
EventHandler ZoneChanged;
public
event
EventHandler NumberChanged;
private
void
TextBoxControls_TextChanged(
object
sender, EventArgs e)
{
switch
(((TextBox)sender).Name)
{
case
"
txtAddress1
"
:
if
(AddressLine1Changed
!=
null
)
{
AddressLine1Changed(
this
, EventArgs.Empty);
}
break
;
case
"
txtAddress2
"
:
if
(AddressLine2Changed
!=
null
)
AddressLine2Changed(
this
, EventArgs.Empty);
break
;
case
"
txtZone
"
:
if
(ZoneChanged
!=
null
)
ZoneChanged(
this
, EventArgs.Empty);
break
;
case
"
txtNumber
"
:
if
(NumberChanged
!=
null
)
NumberChanged(
this
, EventArgs.Empty);
break
;
}
}
[Category(
"
NumberData
"
), DescriptionAttribute(
"
Gets or sets the Number value
"
), DefaultValue(
""
)]
public
string
Number
{
get
{
return
this
.txtNumber .Text; }
set
{
if
(txtNumber.Text
!=
value)
{
txtNumber.Text
=
value;
if
(NumberChanged
!=
null
)
NumberChanged(
this
, PropertyChangedEventArgs.Empty);
}
}
}
[Category(
"
AddressData
"
), DescriptionAttribute(
"
Gets or sets the AddressLine1 value
"
), DefaultValue(
""
)]
public
string
AddressLine1
{
get
{
return
txtAddress1.Text; }
set
{
if
(txtAddress1.Text
!=
value)
{
txtAddress1.Text
=
value;
if
(AddressLine1Changed
!=
null
)
AddressLine1Changed(
this
, PropertyChangedEventArgs.Empty);
}
}
}
[Category(
"
AddressData
"
), DescriptionAttribute(
"
Gets or sets the AddressLine2 value
"
), DefaultValue(
""
)]
public
string
AddressLine2
{
get
{
return
txtAddress2.Text; }
set
{
if
(txtAddress2.Text
!=
value)
{
txtAddress2.Text
=
value;
if
(AddressLine2Changed
!=
null
)
AddressLine2Changed(
this
, PropertyChangedEventArgs.Empty);
}
}
}
[Category(
"
ZoneData
"
), DescriptionAttribute(
"
Gets or sets the Zone value
"
), DefaultValue(
""
)]
public
string
Zone
{
get
{
return
txtZone.Text; }
set
{
if
(txtZone.Text
!=
value)
{
txtZone.Text
=
value;
if
(ZoneChanged
!=
null
)
ZoneChanged(
this
, PropertyChangedEventArgs.Empty);
}
}
}
public
UserControl1()
{
InitializeComponent();
}
}
}
【Blog】
http://virusswb.cnblogs.com/
【MSN】
jorden008@hotmail.com
【说明】转载请标明出处,谢谢
反馈文章质量,你可以通过快速通道评论:
查看全文
相关阅读:
LASSO回归原理和Python代码 | 线性回归 | 交叉验证
初探投行 | 金融
癌症疫苗 | Cancer Vaccines
文献复现 | Machine Learning on Human Muscle Transcriptomic Data for Biomarker Discovery and TissueSpecific Drug Target Identification
癌症研究必备基础知识 | 生信
初探RNA | RNA分类 | miRNA | lncRNA
PubMed文献数据挖掘
罕见病 | 国内 | 国外 | 市场状态
医保目录谈判 | 国家带量采购 | DRG/DIP支付方式改革 | 腾笼换鸟
TCGA数据挖掘基本教程
原文地址:https://www.cnblogs.com/virusswb/p/1206914.html
最新文章
layui 分片上传PHP后端
Linux 系统乱码解决方案
Linux 定时清理日志文件
PHPExcel Continue 2的问题
ThinkPHP 命令行工具
Homebrew 软件介绍
CLR错误:80004005 如何解决?
Jitsi Meet:免费使用的开源视频会议服务
PHP发邮件工具swiftmailer
Wamp cachegrind 缓存清理工具
热门文章
QIAGEN Ingenuity Pathway Analysis (QIAGEN IPA) 软件分析
转录因子相关性网络 | TF network analysis
Representation Learning | 表征学习
google form神器巧用
巫师财经 | 李自然说 | 资本 | 资产
单细胞空间转录组 | scRNAseq
R版本及R包版本的管理 | 历史版本
临床基本概念 | 单臂双臂三臂临床试验
心脏发育 | Embryo Heart Development
什么是卖方分析师?
Copyright © 2011-2022 走看看