- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
PAGE
PAGE 24
Ch2 –User Interface
In this chapter you will learn to use several more control types: text boxes, group boxes, check boxes, radio buttons, and picture boxes.
Text Boxes
Text box control is used when you want the user to type some input.
Refer slide to see sample form. In figure 1, the form has two text boxes.
Figure 1
The user can move from one box to the next, make corrections, cut and paste if desired, and click the Displaybutton when finished.
In your program code, you can use the Text property of each text box.
Example
nameLabel.Text = nameTextBox.Text;
In this example, whatever the user enters into the text box is assigned to the Text property of nameLabel.
If you want to display some text in a text box during program execution, assign a literal to the Text property:
messageTextBox.Text = Watson, come here.;
messageTextBox.Text = Watson, come here.;
You can set the TextAlign property of text boxes to change the alignment of text within the box.
In the Properties window, set the property to Left, Right, or Center. In code, you can set the property using these values:
HorizontalAlignment.Left HorizontalAlignment.Right HorizontalAlignment.Center
messageTextBox.TextAlign = HorizontalAlignment.Left;
messageTextBox.TextAlign = HorizontalAlignment.Left;
Masked Text Boxes
A specialized form of the TextBox control is the MaskedTextBox .
You can specify the format (the Mask property) of the data required of the user.
For example, you can select a mask for a ZIP code, a date, a phone number, or a social security number.
Figure shows the Input Mask dialog box, where you can select the mask and even try it out.
Figure 2
At run time, the user cannot enter characters that do not conform to the mask.
For example, the phone number and social security number masks do not allow input other than numeric digits.
Note: For a date or time mask, the user can enter only numeric digits but may possibly enter an invalid value; for example, a month or hour grea
您可能关注的文档
最近下载
- 2025年江苏省初中学业水平考试(镇江市卷)中考英语试题含解析答案.pdf VIP
- 中核新能源人员行为安全“红黄线”管理办法(试行)培训考试试卷.docx
- 福建教育学院学前教育平时作业答案.docx VIP
- DB63T 662-2023高寒草地施肥技术规范.docx VIP
- 人教版2025秋小学数学三年级教学课件数量间的乘除关系连续两问的实际问题.pptx VIP
- 平行线专项证明题.doc VIP
- 人教版2025秋小学数学三年级教学课件数量间的乘除关系整理和复习.pptx VIP
- 2024年外泌体市场需求分析.pdf VIP
- 防城港市城市投资发展集团有限公司招聘笔试真题2024 .pdf VIP
- 人教版2025秋小学数学三年级教学课件数量间的乘除关系提问题、补条件.pptx VIP
文档评论(0)