======================================================================
Postal Code Custom Control
Developed for Windows Mobile Developer Conference
San Francisco, CA
March 2004
======================================================================
(c) Copyright 2004 Paul Yao and David Durant
All rights reserved.
======================================================================
An extra sample provided for readers of:
.NET Compact Framework Programming with C#
By Paul Yao and David Durant
Published by Addison Wesley
For details on this book and its source code, browse to the book's
web site: http://www.paulyao.com/cfbook
======================================================================
The Postal Code Custom Control shows a custom control that is created
by inheriting from the TextBox class. The control provides some degree
of filtering for postal codes. In some cases, postal codes are just
digits (as in USA, Mexico, Singapore, etc.); in some cases, postal
codes can contain letters (as in Canada, and United Kingdom) as well
as spaces and hyphens.
Each country has rules about the format for a "correct" postal code.
While this sample control uses a very simple rule - that the maximum
number of characters has been entered - with a bit of work this can
be extended to help validate the postal codes by the custom control.
(For details on Postal Code formats, visit the Universal Postal Union
web site, http://www.upu.org.)
This sample shows four steps in the creation of a custom control:
1) Start_SimpleApp
2) Step1_Control_In_App
3) Step2_Control_In_Dll
4) Step3_Control_In_Designer
Details of each step appear below:
======================================================================
1) Start_SimpleApp
This is a simple Pocket PC program that has uses a TextBox to
accept the postal code.
======================================================================
2) Step1_Control_In_App
In this step, a new class has been created to provide validation for
postal codes. The class is still built into the application, but is in
a separate class (which makes it easier to move it to its own DLL).
======================================================================
3) Step2_Control_In_Dll
In this step, the control class is put in a separate DLL. This is the
first step in giving a control a life of its own separate from its
application. But one more step is needed still...
======================================================================
4) Step3_Control_In_Designer
To create support for a custom control in the Visual Studio .NET Designer,
we must build a version of the DLL that relies on the desktop .NET
Framework. And so getting designer support for a custom control involves
creating two separate DLLs from the same (or similar) source files: a
device-side DLL (which was done in step 3), and a designer-side DLL.
These DLLs are copied to known locations for the Designer to find
them, namely:
Location of Device-Side DLL:
..\CompactFrameworkSDK\v1.0.5000\Windows CE
Location of Designer DLL:
..\CompactFrameworkSDK\v1.0.5000\Windows CE\Designer
Both directories are installed within the Microsoft Visual Studio .NET
2003 program files directory tree.
======================================================================
没有合适的资源?快使用搜索试试~ 我知道了~
配书代码-Dot Net compactframework programming with c#
共862个文件
cs:304个
resx:106个
user:88个
4星 · 超过85%的资源 需积分: 10 14 下载量 3 浏览量
2007-10-13
21:15:34
上传
评论
收藏 1.29MB ZIP 举报
温馨提示
Dot Net compactframework programming with c#<br>一书的源代码 c#版<br>Paul Yao写的,强烈推荐
资源推荐
资源详情
资源评论
收起资源包目录
配书代码-Dot Net compactframework programming with c# (862个子文件)
Global.asax 76B
DataSupplier.asmx 98B
Service1.asmx 90B
Primes.asmx 86B
SPADE.BMP 382B
DIAMOND.BMP 382B
HEART.BMP 382B
CLUB.BMP 382B
BELL.BMP 382B
CUP.BMP 382B
two.bmp 126B
one.bmp 126B
two.bmp 126B
one.bmp 126B
SiteAssemblies.cmd 406B
Web.config 4KB
ShowParam.cpp 7KB
TestFontList.cpp 7KB
YaoDurantControls.cpp 6KB
FontList.cpp 4KB
EventGrabber.cpp 3KB
YDControl.cpp 2KB
SimpleBlockModeInvoke.cpp 1KB
StdAfx.cpp 308B
StdAfx.cpp 304B
StdAfx.cpp 299B
StdAfx.cpp 296B
StdAfx.cpp 296B
StdAfx.cpp 295B
PrintDirect.cs 40KB
PrintGdi.cs 40KB
PrintHPMobile.cs 39KB
PrintField.cs 39KB
TextEdit.cs 33KB
Rapi.cs 31KB
FormMain.cs 26KB
ToolBar.cs 26KB
TextColor.cs 25KB
FormMain.cs 19KB
FormMain.cs 19KB
FormMain.cs 18KB
FormMain.cs 17KB
GenericFonts.cs 16KB
ProgramMenu.cs 16KB
ShowBitmap.cs 16KB
GameNewDialog.cs 15KB
FormMain.cs 15KB
TextAlign.cs 14KB
WordWrap.cs 14KB
MyAddress.cs 14KB
TextBoxClipboard.cs 14KB
MyAddress.cs 14KB
MyAddress.cs 14KB
FormMain.cs 14KB
FormMain.cs 14KB
FormMain.cs 13KB
Form1.cs 13KB
FormMain.cs 13KB
FormMain.cs 12KB
UtilData.cs 12KB
UtilData.cs 12KB
UtilData.cs 12KB
UtilData.cs 12KB
UtilData.cs 12KB
UtilData.cs 12KB
Form1.cs 12KB
DlgOptions.cs 12KB
DlgOptions.cs 12KB
DlgOptions.cs 12KB
FormMain.cs 12KB
DlgOptions.cs 12KB
DlgOptions.cs 12KB
DlgOptions.cs 12KB
DateBox.cs 11KB
FileDialogs.cs 11KB
DlgFileProperties.cs 11KB
DialogBoxes.cs 11KB
FormMain.cs 11KB
MeasureString.cs 11KB
DateBox.cs 11KB
LifeGeneration.cs 10KB
LifeMain.cs 10KB
MyAddress.cs 10KB
Squares.cs 10KB
FormMain.cs 10KB
FormMain.cs 10KB
FormMain.cs 10KB
FormOneRow.cs 10KB
FormOneRow.cs 10KB
GCInfo.cs 10KB
JaspersDots.cs 10KB
FormGridsBetter.cs 10KB
CallWin32.cs 9KB
FormGrids.cs 9KB
FormGridsBetter.cs 9KB
FormMain.cs 9KB
Global.asax.cs 9KB
FormMain.cs 9KB
FormMain.cs 9KB
RotateText.cs 8KB
共 862 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
- lzlssj2012-04-06资源比较齐全,深度不够,多谢。
- adewhh2012-02-25包括C++和C#两部分代码,比较全,但更偏界面部分,谢谢分享。
xiaoyunio
- 粉丝: 1
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功