Lecture 2- User Interface lecture
Lecture2
义勇军进行曲写于1935年,于1982年12月4日被全国 人民代表大会正式选作中国人民共和国国歌。
National Capital
• Beijing is not only the nation’s political centre, but also serves as its economic, scientific and cultural heart. Being one of the famous ancient capital cities in China, Beijing has gone through great development and changes since the founding of the PRC in 1949. There are many places of historic interest and scenic beauty in Beijing, such as: Forbidden City, Temple of Heaven, Summer Palace, Ming Tombs and the world-renowned Badaling section of the Great Wall. 北京不仅是中国的政治中心,也是经济、 科学和文化中心。作为中国最著名的古都之一, 北京自1949年中国人民共和国成立以来历经伟 大的发展和变化。在北京有很多历史古迹与风 景名胜,如:紫禁城、天坛、颐和园、明十三 陵和世界闻名的八达岭长城。
National Flag
• Chinese People’s Political Consultative Conference • CPPCC • 中华人民共和国政治协商会议 • Communist Party of China
Lecture_2
Advantages • chemical processing industry has standardized on this electrode • convenient • rugged/durable
Disadvantages • solubility of KCl/NaCl temperature dependent dE/dT = -0.73 mV/K (must quote temperature)
– Ag/AgCl(s) – Hg/Hg2Cl2(s)/Cl- (saturated calomel electrode; SCE)
Electrode of the Second Kind
• Electrode response given by: • E = E0 - (RT/F) ln a(Cl-) • NOTES:
– liquid
• dropping mercury electrode (DME)
• Semiconductors
– Si, GaAs – In-SnO2/glass (optically transparent)
Carbon
• Paste
– With nujol (mineral oil)
• Glassy carbon (GC)
Electrode Hg(l)/Hg2Cl2(s)/KCl (0.1 M) Hg/Hg2Cl2(s)/KCl (1 M) Hg(l)/Hg2Cl2(s)/KCl (sat'd) Hg(l)/Hg2Cl2(s)/ NaCl (sat'd) Acronym Potential vs. SHE 0.3337 0.2801 0.2412 0.2360
– anion activity determines potential – make great reference electrodes because of low solubility of salt (potential very stable)
Lecture 2
2. How do you do? •
(好) 你好吗?
• Fine,thank you. • (饭,三克 油。) 很好,谢谢。 • Very well, thanks. • (外瑞 威尔,三克斯。) • 很好,谢谢。
问候基本句型
3. Good morning!
早上好! Good afternoon! 下午好! Good evening! 晚上好! 4. How is …? …好吗? 3. Good morning! Good afternoon! Good even I’m(=I am)… (爱 母…) 我是… • I’m from...
(爱 母 芙蓉母…)
我是来自于...
介绍的相关词汇
• name ( 内母) 名字 • what (沃特) 什么 • is (一子) 是 are(阿) 是 • his 他的 my(卖) 我的 her(喝) 她的 your(哟) 你的 • he() 他 I(爱) 我 she(睡) 她 you(油) 你 • son (桑) 儿子 daughter(多特)女儿
• 早上好! • 下午好! • 晚上好!
• (Good!) • Goodbye!
• 故的 • 故的拜
• (好!) • 再见!
问候基本句型
1. Hello! /Hi! 你好! 1. Hello! /Hi!
2. How do you do?第一次见面时用
(好 度 油 度?) 你好吗?
How are you?熟悉后用
•
4. …is fine,thank you. And you? • (…一字 饭,三克 油。安的油) …很好,谢谢。你呢? • …is very well, thanks. • (…一字 外瑞 威尔,三克斯。) • …很好,谢谢。
Lecture2
=have an effect on... =have an influence on...
e.g. Forgiveness and encouragement can make a great difference to a
child's future.
□ embarrassed embarrassing
□ forgive
v.原谅
e.g. We are always told to forgive and forget, for there is a saying “to err is
human, to forgive divine”.
□ make a difference to...
对......产生影响
Useful Words
□ forgiveness
n.宽恕;饶恕
ask forபைடு நூலகம்beg for forgiveness 请求/乞求原谅
e.g. The little boy begged me for forgiveness when he learned what he did
hurt me badly.
a.感到尴尬的 a.令人尴尬的
e.g. I felt very embarrassed when I found my students making fun of me,
for this was very embarrassing.
□ keep/stay calm 保持冷静; calm/cool down 冷静下来
所有(三者以上) 任何一个(三者以上) 没有一个(三者以上)
e.g. All of the apples are small. You can take any of them. None of them is ripe.
Lecture 2
How to use the dictionary (4)
India is the smuggler’s delight. 印度是走私者的快乐。
1 [U] a feeling of great pleasure and satisfaction: to sb's delight/to the delight of sb// --To the delight of his proud parents, he has made a full recovery.// 2 [C] something that makes you feel very happy or satisfied: --It was a delight to see him so fit and healthy. 3 take delight in (doing) sth: to enjoy something very much, especially something you should not do// --Chris takes great delight in teasing his sister.//
How to use the dictionary (2)
3. An encounter with someone is a meeting with them, particularly one that is unexpected or significant. The author tells of a remarkable encounter with a group of South Vietnamese soldiers. 4. An encounter is a particular type of experience. E.g.: ...a sexual encounter.// ...his first serious encounter with alcohol. from Collins COBUILD Dictionary 改译:?
Lecture-2
北桥和南桥
北桥是主板上离CPU最近的一块芯片,负责与 CPU的联系并控制内存、AGP、PCI数据在北桥 内部传输。 南桥主要负责I/O接口以及IDE设备的控制等。 I/O IDE MCH(memory controller hub),内存控制器中 心,负责连接CPU,AGP总线和内存。 ICH(I/O controller hub),输入/输出控制器中 心,负责连接PCI总线,IDE设备,I/O设备等。
主板的架构
主板的架构是指主板提供的CPU安装插座 (或插槽)标准。PC机从386时代开始使用 socket插座来安装CPU,从socket4、socket5、 socket7、socket432、socket478、 socket775、 socket754。
常见的CPU插槽
常见的CPU插槽标准
Socket 5
具有321个插孔 是CPU进入“奔腾”时代最常 用的一种主板架构 66/75/90/120/133/166
Socket 7主板
这种主板采用方形多针脚插座,具有321个插孔, 是CPU进入“奔腾”时代后最常用的一种主板 架构,这种主板支持Pentium MMX、AMD K6、 AMD K6-2、AMD K6-Ⅲ、Cyrix 6x86、Cyrix MⅡ、M Ⅲ等CPU。
主板的类型
AT板型 ATX(AT eXternal)板型 Micro-ATX板型
主板上各种标号
RX 电阻 RNX 排电阻 CX 电容 QX 三极管 LX 电感 Xx(Yx)(XTALx)晶振 UX 芯片位置 BAT(BTX) 电池 JP 跨接线 CPU-FAN CPU风扇 FS0 FS1 FS2 CPU 外部时钟频率选择 SKP 扬声器 POWER +5V电源 BF0 BF1 BF2 BF3 倍频调整跳线 KEY LOCK 键盘锁 RESETER 清零 EXT BAT 电池跳线 HD LED 硬盘灯
lecture 2
A landmark decision yesterday by an industrial tribunal on pension equality could leave the UK pension industry facing extra costs of £13 billion a year. 昨天一行业纠纷审理委员会作出一项史无前 例的裁决。此举可能使英国的养老金管理事 业每年要多支出130亿英镑。
But public outrage over abuse of privilege continued to mount, fueled by allegations of dope dealing at the House Post Office, unpaid bills at the exclusive members’ dining room and extravagant junketeering at taxpayers’ expense. 公众对国会议员滥用特权的义愤有增无减。 有些议员被指利用国会邮政所从事毒品交易, 有的被指控在专门餐厅用餐不付帐,有的被 指控华纳税人的钱公费旅游,这些更使公众 怒不可遏。
Foreign firms have increasingly turned to China to supply parts or make products, and such deals have been a hot political topic in the run-up to the US presidential elections as industry groups worry about losing ground to low-cost Chinese competitors. 外国企业越来越多地转向中国,或提供部件, 或制造产品。而这类交易成了美国总统竞选 前期的一个热门话题,因为一些行业担心在 中国低成本的竞争者面前处于下风。
Lecture 2
Problems with customer relations
Have you ever phoned a company helpline? If yes, has this solved your problem? What goods or services have given you problems? What methods do companies have for solving the problems?
Key expressions for chairing a meeting
Well, we don’t have to decide on this today. don’ Let’ Let’s think about it more and come back to it if necessary next week. Now, let’s take a five-minute break and let’ fivethen start on point number six. So we need more information on this issue. So, in summary, we’ve agreed about… we’ about… So we’re just left with the question of the we’ timing of the event. Any ideas, anyone? Ok. Let’s come to a quick decision on this. Let’ How many of you are in favor of …? Any against? Well, thank all of you for your time. I think this… this…
Lecture 2 词法翻译1
Exercises
你这是什么意思?请别误会我的意思。 What do you mean by that? Please do not misunderstand me. 她被夸得不好意思。 She felt embarrassed by so much praise. 让你久等了,不好意思。 I'm sorry to have kept you waiting so long. 做了这种事,亏他还好意思说呢! Fancy his doing that sort of thing and then having the nerve to talk about it.
2015-2-25
14
English College
Compare the following two translation versions. 他们正在积极巩固成果。 Version A: They were actively consolidating their victorious gains. Version B: They were actively consolidating their victories. Comment: “victorious gains” sometimes refers to things grabbed from the captured.
2015-2-25 18 English College
1. 他穿一身浅灰色底子淡蓝色条子的西装,打着一条玫瑰红的领 带。 He was dressed in a European- style suit of a pale-grey material with pale-blue stripes and a rose-red tie. 2. 一轮血红的刚升起来的太阳。 The rising sun was a blood-red disc. 改换颜色词 3. 封面和封底是重磅的米色道林纸,边上打了两个眼。(米色不译 成rice-colored) The covers were of heavyweight, buff-colored calendered paper with two holes punched in the edges. 4. 她脸色突然变成灰黄,死了似的。 (英语中一般用pale来形容。) All of a sudden, her face turned ashy pale, like a corpse. 5. 他便变了脸,铁一般的青。 His complexion changed, and he grew ghastly pale. English College 2015-2-25 19
英语听课笔记范文10篇试卷讲解
英语听课笔记范文10篇试卷讲解Lecture Notes Template 1。
Title: Introduction to Artificial Intelligence.Lecturer: Dr. Emily Jones.Date: September 5, 2023。
Key Concepts:Artificial Intelligence (AI): The science of creating intelligent machines that can perform tasks typically requiring human intelligence.Machine Learning (ML): A subset of AI that allows computers to learn from data without explicit programming.Deep Learning (DL): A type of ML that uses artificial neural networks to process data and make predictions.Natural Language Processing (NLP): A field of AI focused on enabling computers to understand and generate human language.Computer Vision (CV): A field of AI that enables computers to analyze and understand images and videos.Lecture Outline:I. What is AI?Definition, scope, and applications.II. Types of AI.Narrow AI vs. General AI.Symbolic AI vs. Statistical AI.III. Machine Learning.Supervised, unsupervised, and reinforcement learning.Algorithms and techniques.IV. Deep Learning.Artificial neural networks.CNNs, RNNs, and LSTMs.V. NLP and CV.Text processing, machine translation, speech recognition.Image classification, object detection, facial recognition.Key Takeaways:AI is a rapidly growing field with the potential torevolutionize many industries.Machine learning and deep learning are fundamental techniques in AI.NLP and CV enable computers to interact with humans and the world in a more meaningful way.Lecture Notes Template 2。
商务英语谈判lecture 2
Case Study
The position of the Chinese company was that it would produce only two models, while the underlying interest was to keep manufacturing costs down. The position of the American importer was that it wanted four models, while its underlying interest was to increase its profits by selling more bicycles. As long as the negotiators focused on these positions, the dispute could be resolved only through concessions by one or both sides.
Business Negotiation English
Case Study
In one negotiation in the early 1980s, a Chinese manufacturer was locked in a dispute with an American importer over how many models of the bicycles his company would produce. The American importer wanted four different models to give its customers greater selection. The Chinese company wanted to produce only two models, to keep manufacturing costs down.
托福听力tpo41 lecture1、2、3、4 原文+题目+答案+译文
托福听力tpo41lecture1、2、3、4原文+题目+答案+译文Lecture1 (2)原文 (2)题目 (4)答案 (5)译文 (6)Lecture2 (7)原文 (7)题目 (9)答案 (11)译文 (12)Lecture3 (13)原文 (13)题目 (16)答案 (18)译文 (18)Lecture4 (20)原文 (20)题目 (22)答案 (24)译文 (24)Lecture1原文FEMALE PROFESSOR:Many organisms have developed the ability to survive in harsh environmental conditions—extreme heat or cold,or,very dry conditions....Like, plants in the desert—your textbook doesn’t have much about the specifics on desert plants,but I think that desert plants are great examples of specialized adaptations to extreme environmental conditions.So with desert plants,there are basically three different adaptive strategies.And I should point out that these strategies are not specific to any particular species—many different species have developed each of the adaptations.So,first off,there are succulent plants.There are many different species of succulent plants,but they all can absorb and store a lot of water.Obviously,opportunities to get water in the desert are few and far between.Generally,rains are light and short,so the rain doesn’t seep too far down into the soil…and there's a limited window of time for any plant to get the water before it evaporates.But succulent plants have a spread-out and shallow root system that can quickly pull in water from the top inch of soil,though the soil has to be saturated,since succulents aren't good at absorbing water from soil that’s only a little moist.Succulent plants also are well suited to retaining water—important in an environment where rainy days are rare.Succulent plants can store water in their leaves,in their stems,or in their roots.And to keep that moisture from evaporating in the hot desert sun,most succulent plants have a waxy outer layer that makes them almost waterproof when their stomates are closed.They also preserve water by minimizing their surface area—the more of the plantthat’s out in the sun,the more potential there is to lose stored-up water—and that means that most succulent plants have few,if any,leaves.Now besides succulent plants,there are also drought-tolerant plants. Drought-tolerant plants are like bears in a way.You know how bears mostly sleep through the winter?They can survive without eating because their metabolism slows down.Well,drought-tolerant plants also go into a dormant state when resources—in their case,water—runs short.A drought-tolerant plant can actually dry out without dying.I said before that most desert rains are light and brief,but occasionally there's a heavy one.Drought-tolerant plants revive after one of these significant rainfalls—and they're able to absorb a good bit of the rainfall due to their deep roots.Actually the root system for drought-tolerant plants is more extensive than the root systems of many plants that live in wetter climates.Drought-tolerant plants can even absorb water from relatively dry soil because of their deep roots,in contrast to succulent plants.The third adaptive strategy is to avoid the drought conditions altogether.Yes,there are plants that do this—annual plants.An annual plant will mature and produce seeds in a single season that will become the next generation of annual plants.In desert conditions,annual plants grow in the fall or spring to avoid the heat of summer and the cold of winter.Of course,these plants could face a serious problem if a particular fall or spring happened to be very dry—they would have difficulty growing and could die before producing seeds.But they have a mechanism to prevent one year of low rainfall from wiping them out. Not all seeds an annual plant puts out will grow the following year.Some seeds remain dormant in the ground for several years.It's a type of insurance that protects the annual plants from a season of poor growing conditions,of unfavorable weather.题目1.What is the lecture mainly about?A.The growth rates of plants in different geographical regionsB.Different ways that plants have adapted to desert environmentsC.The different mechanisms that plant roots use to absorb waterD.Different kinds of succulent plants2.What are two features of succulent plants that help them survive in deserts?[Click on2answers.]A.Succulent plants store water in their leaves and stems.B.Succulent plants become dormant until the next rainfall.C.Succulent plants have short stems.D.Succulent plants have few leaves.3.Why does the professor mention bears?A.To remind students of information from a previous lectureB.To point out a feature common to all desert plantsC.To reinforce a point about drought-tolerant plantsD.To help students understand the concept of adaptation4.What is one ability that drought-tolerant plants have that succulent plants do not have?A.The ability to absorb water from dry soilB.The ability to absorb water through their leavesC.The ability to prevent moisture from being lost through their leavesD.The ability to shed leaves5.Why can annual plants grow in a desert even after a year of no rainfall?A.Annual plants have an extensive root system that can absorb water from far away.B.Annual plants produce seeds all year long.C.Seeds of annual plants can store water for a long time.D.Seeds of annual plants can survive in the ground for a long time without water.5.Listen again to part of the lecture.Then,answer the question.(PROFESSOR)The third adaptive strategy is to avoid the drought conditions altogether.Yes,there are plants that do this.Why does the professor say this: (PROFESSOR)Yes,there are plants that do this.A.To correct a previous statementB.To acknowledge a potentially surprising factC.To anticipate the types of questions that students might have about the topicD.To make sure that students are paying attention答案B ADC AD B译文教授:许多生物已经发展了在恶劣环境中生存的能力:酷热、严寒,或者非常干燥的环境。
Lecture-2
• 一、西方古代社会的管理实践和思想(6世纪以前) • 二、西欧中世纪的管理实践和思想
• 三、欧洲文艺复兴对管理思想发展的影响
一、西方古代社会的管理实践和思想 (6世纪以前)• 1、关于西方和西方国家的概念
• 2、古希腊的管理制度与思想
• 3、古罗马的管理制度与思想
• 4、宗教所体现的管理思想
• 5、早期管理思想的主要特点
• 认为治国人才必须受过良好教育,主张通过教育来培养 治国人才,对管理人员要进行选拔。为了造就治国人才, 苏格拉底非常重视教育,付出了毕生的精力。 • 关于教育的内容:培养人的美德,教人学会做人,成为 有德行的人;要教人学习广博而实用的知识;主张教人
岸重要港口。人口27.1万。主要建于离岸4公
里的海边浅水滩上,平均水深1.5米。
• 由铁路、公路、桥与陆地相连。由118个小岛
组成,并以 177条水道、401座桥梁连成一体, 以舟相通,有“水上都市”、“百岛城”、 “桥城”之称。
管理和拯救威尼斯:水的魅力与困扰
• 水——曾是威尼斯的保护神,现却成了威尼斯最大的敌人。 • 1966年,威尼斯发生大洪灾,城内水位高达1米——防洪是 国家头等大事。 • 每100年,威尼斯就会下沉1.3厘米。二战后,每20年内下 沉30厘米,威尼斯人生活的中心——圣马可广场只高于警 戒水位30厘米。 • 2001年1月,威尼斯遭受了历史上最为严重的水灾,洪水持 续了4天4夜,城市的大半部分都淹没在水中。 • 2008年10月1日,威尼斯经历了22年以来最大的一次水灾。 • 如何管理和拯救威尼斯? 2009年10月新动工建设一项耗资 30亿美元的新防洪闸门工程。 2012年10月12日,威尼斯遭受水灾
• 城邦所设的行政官员都是义务职,不支薪水;全部行政 官员并不组成为某个行政首脑统一领导下的“政府”。
Lecture2
BACK
Reading and Vocabulary
expose
01 vt.使…暴露于;使…了解熟悉
e.g. Potatoes turn green when expose to light.
暴露在光下的土豆会变
绿。
Warming up
BACK
Reading and Vocabulary
Warming up业知识的机会。
BACK
Reading and Vocabulary
explore one’s
01 strength
探寻一个人的优势
e.g. You shall take this opportunity to explore your strength.
你应该把握这个机会探寻
Warming up你的优势。
BACK
figure out
解决,算出
01
e.g. It took them about one month to figure out how to start the equipment.
Warming up他们用了大约一个月的
时间才弄明白如何启动 这台设备。
Reading and Vocabulary
ambition
n野. 心,抱负
01
e.g. His ambition is to sail around the world.
他的理想是航行环游世
界。
Warming up
BACK
Reading and Vocabulary
BACK
first-hand
01 第一手的,直接的
e.g. School trips give children first-hand experience not available in the classroom.
Lecture 2
How Does Culture Related to Language?
• 他当经理之后公司一直赢利(赚钱)。 • Since he became manager, the company has been in the black. • 你妈妈来信说她同意你和我一起来。现在我们有 白纸黑字为凭。 • This letter’s from your mother saying she agrees to your coming with me. Now we have it in black and white. • 在州商品展览会上他的参赛品获得了一等奖。 • His entry at the state fair won a blue ribbon.
What is Culture?
• “Culture is man’s medium; there is not one aspect of human of life that is not touched and altered by culture. This means personality, how people express them selves, including shows of emotion, the way they think, how they move, how problems are solved, how their cities are planned and laid out, how transportation systems function and are organized, as well as how economic and government systems are put together and function.” (Edward T. Hall, 1959)
lecture02
CHAPTER 2
The Data of Macroeconomics
slide 7
Gdp的核算
一国一定时期内所生产的所有最终产品和
服务的市场价值
苹果和橘子如何相加? 二手货 存货
CHAPTER 2
The Data of Macroeconomics
slide 8
Imputed Value(估算值)
事实上,我们假设企业购买自己的产品
In effect, we are assuming that firms purchase their unsold output.
CHAPTER 2
The Data of Macroeconomics
slide 27
GDP: An important and versatile concept
包括: 企业固定投资 spending on plant and equipment that firms will use to produce other goods & services 住房固定投资 spending on housing units by consumers and landlords 存货投资 the change in the value of all firms’ inventories
slide 26
Why output = expenditure
没有售出的产出转为存货,并被算入存 货投资,无论该投资是有意的还是被迫 的Unsold output goes into inventory, and is
counted as “inventory investment”…whether the inventory buildup was intentional or not.
lecture 2 翻译技巧
(3)The beauty of lasers is that they can do machining without ever physically touching the material. 激光的妙处在于它能进行机械加工而不必实 际接触所加工的材料。 (不宜译为“美丽”)
(4)The wireless sensor network is a useful tool for managing the automatic controls inside the greenhouse. 无线传感器网络对于温室内自动控制器的管 理十分有用。
(8)The shortest distance between raw material and a finished part is casting. 铸造是把原材料加工成成品的最简便方法。 (不译为“最短的距离”)
(9)Science has become a source of power, not merely a subject fit for fiction. 科学已成为一种力量源泉,而不只是作为幻 想的主题了。 讨论:fiction的其他可能译法。如: 科幻小说?
三、词义的选择与引申
英语词汇丰富,一词多用、一词多义现象非 常普遍,而且有些词在汉语中没有对应的表 达,所以在具体的上下文中确定词义是翻译 的一个基本功,需要认真对待。
1. 词义的选择
词义的选择可从词性、上下文、所属领域或专业 等方面考虑。
试译以下各句,注意一词多义现象。
(1)He was wet to the skin. 他全身湿透了。 (2)At that time he was still wet behind the ears. 那时候他仍然有些乳臭未干。 (3)If you think I am for him, you are all wet. 如果你认为我支持他,那你就大错特错了。
lecture 2
Part 2: Character and performance
Two ways to cast stars Off casting: is opposite to typecasting, refers to the
assignment of a role to a star which is quite different to their usual role. Example: Harrison Ford---from a rogue with a heart of gold to respectable professionals and honest family men.
Part 2: Character and performance
Two ways to cast stars Typecasting: iin kinds of
roles to a performer, a known product. Example: Hugh Grant—a romantic comedy about a good-natured but slightly confused and easily embarrassed Englishman with a dry, ironic sense of humor.(p.30)
Part 2: Character and performance
2.Characters 1) Three basic functions or categories of character Main characters: the protagonist Example: Sherlock Holmes Secondary characters: (the opposition character, the mirror character and the romance character) Example: Lord Blackwood , Holmes’ friend, Dr. John Watson, Irene Adler Minor characters: the unimportant characters Example: Lord Coward, Sir Thomas, the servant (each of those has a certain role to play)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Ch2 – User InterfaceIn this chapter you will learn to use several more control types: text boxes, group boxes, check boxes, radio buttons, and picture boxes.Text Boxes1.Text box control is used when you want the user to type some input.2.Refer slide to see sample form. In figure 1, the form has two text boxes.Figure 13.The user can move from one box to the next, make corrections, cut and paste ifdesired, and click the Display button when finished.4.In your program code, you can use the Text property of each text box.5.ExamplenameLabel.Text = nameTextBox.Text;6.In this example, whatever the user enters into the text box is assigned to the Textproperty of nameLabel.7.If you want to display some text in a text box during program execution, assign aliteral to the Text property:messageTextBox.Text = "Watson, come here.";8.You can set the TextAlign property of text boxes to change the alignment of textwithin the box.9.In the Properties window, set the property to Left, Right, or Center. In code, youcan set the property using these values:HorizontalAlignment.LeftHorizontalAlignment.RightHorizontalAlignment.CentermessageTextBox.TextAlign = HorizontalAlignment.Left;Masked Text Boxes1. A specialized form of the TextBox control is the MaskedTextBox .2.You can specify the format (the Mask property) of the data required of the user.3.For example, you can select a mask for a ZIP code, a date, a phone number, or asocial security number.4.Figure shows the Input Mask dialog box, where you can select the mask and eventry it out.Figure 25.At run time, the user cannot enter characters that do not conform to the mask.6.For example, the phone number and social security number masks do not allowinput other than numeric digits.7.Note: For a date or time mask, the user can enter only numeric digits but maypossibly enter an invalid value; for example, a month or hour greater than 12.8.The mask will accept any numeric digits, which could possibly cause your programto generate a run-time error. You will learn to check the input values in Chapter 4. Rich Text Boxes1.Another variety of text box is the RichTextBox control, which offers severalformatting features (Figure 3).Figure 32.In a regular text box, all of the text is formatted the same, but in a rich text box, theuser can apply character and paragraph formatting to selected text, much like usinga word processor.3.One common use for a rich text box is for displaying URL addresses.4.In a regular text box, the address appears in the default font color, but the rich textbox displays it as a link when the DetectUrl property is set to true.5.Note that it is not an active link, but it does have the formatting to show the URL asan address.6.You also can load formatted text into a rich text box from a file stored in rich textformat (rtf).e the LoadFile method of the rich text box.8.In Figure 3 above, the file “Rich Text Boxes.rtf” is stored in the bin\debug folder,but you could include the complete path to load a file from another location.sampleRichTextBox.LoadFile("Rich Text Boxes.rtf");Displaying Text on Multiple Lines1.Both the regular text box and the rich text box have properties that allow you todisplay text on multiple lines.2.The WordWrap property determines whether the contents should wrap to asecond line if they do not fit on a single line.3.The property is set to true by default.4.Both controls also have a Multiline property, which is set to false by default on atext box and true by default on a rich text box.5.Both WordWrap and Multiline must be set to true for text to wrap to a second line.6.For a regular text box, you must set Multiline to true and then adjust the height toaccommodate multiple lines.7.If Multiline is false(the default), a text box does not have resizing handles forvertical resizing.8.Be aware that a text box will not automatically resize to display multiple lines eventhough Multiline is true; you must make the height tall enough to display the lines.Figure 49.You can set the Text property of a multiline text box (or rich text box) to a very longvalue; the value will wrap to fit in the width of the box.10.You also can enter multiple lines and choose the location of the line breaks; thetechniques differ depending on whether you set the Text property at design time or in code.11.At design time, click on the Text property in the Properties window and click on theProperties button (the down arrow); a small editing window pops up withinstructions to press Enter at the end of each line and Ctrl + Enter to accept the text (Figure 2.5).12.In code, you can use a NewLine character (Environment.NewLine) in the text stringwhere you want the line to break.13.Joining strings of text is called concatenation and is covered in the section“Concatenating Text” later in this chapter.titleRichTextBox.Text = " Pamper Yourself" +Environment.NewLine + "All Your Favorite Books";Group Boxes1.Group boxes are used as containers for other controls.ually, groups of radio buttons or check boxes are placed in group boxes.ing group boxes to group controls can make your forms easier to understand byseparating the controls into logical groups.4.You can find the GroupBox control in the Containers tab of the toolbox.5.Set a group box’s Text property to the words you want to appear on the top edge ofthe box.6.Example Names for Group BoxescolorGroupBoxstyleGroupBox7.You only need to change the name of a group box if you plan to refer to it in code.8.One reason to use it in code is to set the Enabled property of the group box to false,which disables all of the controls inside the box.Check Boxes1.Check boxes allow the user to select (or deselect) an option.2.In any group of check boxes, any number can be selected.3.The Checked property of a check box is set to false if unchecked or true if checked.4.You can write an event handler for the CheckedChanged event, which executeswhen the user clicks in the box.5.In Chapter 4, when you learn about if statements, you can take one action when thebox is checked and another action when it is unchecked.e the Text property of a check box for the text you want to appear next to the box.7.Example Names for Check BoxesboldCheckBoxitalicCheckBoxRadio Buttonse radio buttons when only one button of a group may be selected.2.Any radio buttons that you place directly on the form (not in a group box) functionas a group.3. A group of radio buttons inside a group box function together.4.The best method is to first create a group box and then create each radio buttoninside the group box.5.When you need separate lists of radio buttons for different purposes, you mustinclude each list in a separate group box.6.You can find an example program later in this chapter that demonstrates using twogroups of radio buttons,one for setting the background color of the form and asecond set for selecting the color of the text on the form. See “Using Radio Buttons for Selecting Colors.”7.The Checked property of a radio button is set to true if selected or to false ifunselected.8.You can write an event handler to execute when the user selects a radio buttonusing the control’s CheckedChanged event.9.In Chapter 4 you will learn to determine in your code whether or not a button isselected. Set a radio button’s Text property to the text you want to appear next to the button.10.E xample Names for Radio ButtonsyellowRadioButtonblueRadioButtonPicture Boxes1. A PictureBox control can hold an image.2.You can set a picture box’s Image property to a graphic file with an extensionof .bmp, .gif, .jpg, .jpeg, .png, .ico, .emf, or .wmf. You first add your images to theproject’s resources; then you can assign the resource to the Image property of aPictureBox control.3.Place a PictureBox control on a form and then select its Image property in theProperties window. Click on the Properties button (Figure 5) to display a SelectResource dialog box, where you can select images that you have already added or add new images (Figure 6).Figure 5Figure 64.Click on the Import button of the Select Resource dialog box to add images.5.An Open dialog box appears (Figure 7), where you can navigate to your image files.Figure 76. A preview of the image appears in the preview box.7.Note: To add files with an .ico extension, drop down the File Type list and select AllFiles in the Open dialog box.8.You can use any graphic file (with the proper format) that you have available.9.You will find many graphic files in the StudentData\Images folder from the textbookWeb site: /csharp2008.10.PictureBox controls have several useful properties that you can set at design time orrun time.11.For example, set the SizeMode property to StretchImage to make the graphicresize to fill the control.12.You can set the Visible property to false to make the picture box disappear.13.For example, to make a picture box invisible at run time, use this code statement:logoPictureBox.Visible = false;Assigning an Image to a Picture Box1.To assign a graphic from the Resources folder at run time, you refer to the projectname (ChangePictures in the following example), the Resources folder in theproject’s properties, and the name of the graphic resource:samplePictureBox.Image = ChangePictures.Properties.Resources.Water_Lilies;Clearing a Picture Box1.Sometimes you may wish to keep the picture box visible but remove the picture.2.To accomplish this, set the Image property to null, which means empty.samplePictureBox.Image = null;Adding and Removing Resources1.In Figure 6 you saw the easiest way to add a new graphic to the Resources folder,which you perform as you set the Image property of a PictureBox control.2.You also can add, remove, and rename resources using the Visual Studio ProjectDesigner.3.From the Project menu, select ProjectName Properties(which always shows thename of the selected project).4.The Project Designer opens in the main Document window; click on the Resourcestab to display the project resources (Figure 8).Figure 85.You can use the buttons at the top of the window to add and remove images, orright-click an existing resource to rename or remove it.Using Smart Tags1.You can use smart tags to set the most common properties of many controls.2.When you add a PictureBox or a TextBox to a form, for example, you see a smallarrow in the upper-right corner of the control. Click on the arrow to open the smart tag for that control (Figure 2.9).Figure 2.93.The smart tag shows a few properties that you can set from there, which is just ashortcut for making the change from the Properties window.Using Images for Forms and Controls1.You can use an image as the background of a form or a control.2.For a form, set the BackgroundImage property to a graphic resource; also set theform’s Backgro undImageLayout property to Tile , Center , Stretch , or Zoom.3.Controls such as buttons, check boxes, and radio buttons have an Image propertythat you can set to a graphic from the project’s resources.Setting a Border and Style1.Most controls can appear to be three-dimensional or flat.bels, text boxes, and picture boxes all have a BorderStyle property with choicesof None , FixedSingle , or Fixed3D .3.Text boxes default to Fixed3D; labels and picture boxes default to None . Of course,you can change the property to the style of your choice.Drawing a Line1.You can draw a line on a form by using the Label control.2.You may want to include lines when creating a logo or you may simply want todivide the screen by drawing a line.3.To create the look of a line, set the AutoSize property of your label to false, set theText property to blank, change the BorderStyle to None, and change the Backcolor to the color you want for the line.4.You can control the size of the line with the Width and Height properties, locatedbeneath the Size property.5.Another way to draw a line on a form is to use the LineShape control, which you candownload and install into Visual Studio. See “Downloading and Using the Line andShape Controls” later in this chapter.6.You also can draw a line on the form using the graphics methods. Drawing graphicsis covered in Chapter 13.Working with Multiple ControlsYou can select more than one control at a time, which means that you can move the controls as a group, set similar properties for the group, and align the controls.Selecting Multiple Controls1.There are several methods of selecting multiple controls.2.If the controls are near each other, the easiest technique is to use the mouse to draga selection box around the controls.3.Point to a spot that you want to be one corner of a box surrounding the controls,press the mouse button, and drag to the opposite corner (Figure 2.10).Figure 2.104.When you release the mouse button, the controls will all be selected (Figure 2.11).Figure 2.115.Note that selected labels and check boxes with AutoSize set to true do not haveresizing handles; other selected controls do have resizing handles.6.You also can select multiple controls, one at a time.7.Click on one control to select it, hold down the Ctrl key or the Shift key, and clickon the next control.8.You can keep the Ctrl or Shift key down and continue clicking on controls you wishto select. Ctrl–click (or Shift–click) on a control a second time to deselect itwithout changing the rest of the group.9.When you want to select most of the controls on the form, use a combination of thetwo methods. Drag a selection box around all of the controls to select them and then Ctrl–click on the ones you want to deselect.10.You also can select all of the controls using the Select All option on the Edit menu orits keyboard shortcut: Ctrl + A.Deselecting a Group of Controls1.When you are finished working with a group of controls, it’s easy to deselect them.Just click anywhere on the form (not on a control) or select another previouslyunselected control.Moving Controls as a Group1.After selecting multiple controls, you can move them as a group.2.To do this, point inside one of the selected controls, press the mouse button, anddrag the entire group to a new location (Figure 2.12).Figure 1.12Setting Properties for Multiple Controls1.You can set some common properties for groups of controls.2.After selecting the group, look at the Properties window.3.Any properties that appear in the window are shared by all of the controls and canbe changed all at once.4.For example, you may want to set the BorderStyle property for a group of controlsto three dimensional or change the font used for a group of labels.5.Some properties appear empty; even though those properties are common to all theselected controls, they do not share a common value.6.You can enter a new value that will apply to all selected controls.Aligning Controls1.After you select a group of controls, it is easy to resize and align them using thebuttons on the Layout toolbar (Figure 2.13) or the corresponding items on theFormat menu.Figure 2.132.Select your group of controls and choose any of the resizing buttons.3.These can make the controls equal in width, height, or both.4.Then select another button to align the tops, bottoms, or centers of the controls.5.You also can move the entire group to a new location.6.Note: The alignment options align the group of controls to the control that is active(indicated by white sizing handles).7.Referring to Figure 2.12, the lower text box is the active control.8.To make another selected control the active control, simply click on it.9.To set the spacing between controls, use the buttons for horizontal and/or verticalspacing.10.These buttons enable you to create equal spacing between controls or to increase ordecrease the space between controls.11.Note: If the Layout toolbar is not displaying, select View / Toolbars / Layout.Designing Your Applications for User Convenience1.One of the goals of good programming is to create programs that are easy to use.2.Your user interface should be clear and consistent.3.One school of thought says that if users misuse a program, it’s the fault of theprogrammer, not the users.4.Because most of your users will already know how to operate Windows programs,you should strive to make your programs look and behave like other Windowsprograms.5.Some of the ways to accomplish this are to make the controls operate in thestandard way, define keyboard access keys, set an Accept button, and make the Tab key work correctly.6.You also can define ToolTips, which are those small labels that pop up when theuser pauses the mouse pointer over a control.Designing the User Interface1.The design of the screen should be easy to understand and “comfortable” for theuser.2.The best way that we can accomplish these goals is to follow industry standards forthe color, size, and placement of controls.3.Once users become accustomed to a screen design, they will expect (and feel morefamiliar with) applications that follow the same design criteria.4.You should design your applications to match other Windows applications.5.Microsoft has done extensive program testing with users of different ages, genders,nationalities, and disabilities.6.We should take advantage of this research and follow their guidelines.7.Take some time to examine the screens and dialog boxes in Microsoft Office as wellas those in Visual Studio.8.One recommendation about interface design concerns color.9.You have probably noticed that Windows applications are predominantly gray.10.A reason for this choice is that many people are color blind.11.Also, research shows that gray is easiest for the majority of users.12.Although you may personally prefer brighter colors, you will stick with gray, or thesystem palette the user chooses, if you want your applications to look professional.13.Note: By default the BackColor property of forms and controls is set to Control,which is a color included in the operating system’s palette.14.If the user changes the system theme or color, your forms and controls will conformto their settings.15.Colors can indicate to the user what is expected.e a white background for text boxes to indicate that the user should inputinformation.e a gray background for labels, which the user cannot change.bels that will display a message should have a border around them; labels thatprovide text on the screen should have no border (the default).19.Group your controls on the form to aid the user.20.A good practice is to create group boxes to hold related items, especially thosecontrols that require user input.21.This visual aid helps the user understand the information that is being presented orrequested.e a sans serif font on your forms, such as the default MS Sans Serif, a do not makethem boldface.23.Limit large font sizes to a few items, such as the company name.Defining Keyboard Access Keys1.Many people prefer to use the keyboard, rather than a mouse, for most operations.2.Windows is set up so that most functions can be done with either the keyboard or amouse.3.You can make your projects respond to the keyboard by defining access keys, alsocalled hot keys.4.For example, in Figure 2.14 you can select the OK button with Alt + o and the Exitbutton with Alt + x. You can set access keys for buttons, radio buttons, and checkboxes when you define their Text properties.Figure 2.145.Type an ampersand (&) in front of the character you want for the access key; VisualStudio underlines the character.6.You also can set an access key for a label; see “Setting the Tab Order for Controls”later in this chapter.7.For examples of access keys on buttons, type the following for the button’s Textproperty:&OK for OKE&xit for Exit8.When you define access keys, you need to watch for several pitfalls.9.First, try to use the Windows standard keys whenever possible.10.For example, use the x of Exit and the S of Save.11.Second, make sure you don’t give two controls the same access key.12.It confuses the user and doesn’t work correctly.13.Only the next control (from the currently active control) in the tab sequence isactivated when the user presses the access key.14.Note : To view the access keys on controls or menus in Windows 2000, Windows XP,or Windows Vista, you may have to press the Alt key, depending on your systemsettings.15.You can set Windows Vista to always show underlined shortcuts in the ControlPanel’s Ease of Access Center .16.Select Change how your keyboard works and check the box for Underline keyboardshortcuts and access keys in the Make the keyboard easier to use dialog.Setting the Accept and Cancel Buttons1.Are you a keyboard user?2.If so, do you mind having to pick up the mouse and click a button after typing textinto a text box?3.Once a person’s fingers are on the keyboard, most people prefer to press the Enterkey, rather than to click the mouse.4.If one of the buttons on the form is the Accept button, pressing Enter is the same asclicking the button.5.You can make one of your buttons the Accept button by setting the AcceptButtonproperty of the form to the button name.6.The Accept button is visually indicated to the user by a thicker border (in defaultcolor scheme, it’s black) around the button.7.When the user presses the Enter key, that button is automatically selected.8.You also can select a Cancel button.9.The Cancel button is the button that is selected when the user presses the Esc key.10.You can make a button the Cancel button by setting the form’s CancelButtonproperty.11.An example of a good time to set the CancelButton property is on a form with OKand Cance l buttons.12.You may want to set the form’s AcceptButton to okButton and the CancelButtonproperty to cancelButton.Setting the Tab Order for Controls1.In Windows programs, one control on the form always has the focus.2.You can see the focus change as you tab from control to control.3.For many controls, such as buttons, the focus appears as a thick border.4.Other controls indicate the focus by a dotted line or a shaded background.5.For text boxes, the insertion point (also called the cursor appears inside the box.6.Some controls can receive the focus; others cannot.7.For example, text boxes and buttons can receive the focus, but labels and pictureboxes cannot.The Tab Order1.Two properties determine whether the focus stops on a control and the order inwhich the focus moves.2.Controls that are capable of receiving focus have a TabStop property, which youcan set to true or false.3.If you do not want the focus to stop on a control when the user presses the Tab key,set the TabStop property to false.4.The TabIndex property determines the order the focus moves as the Tab key ispressed.5.As you create controls on your form, Visual Studio assigns the TabIndex property insequence.6.Most of the time that order is correct, but if you want to tab in some other sequenceor if you add controls later, you will need to modify the TabIndex properties of your controls.7.When your program begins running, the focus is on the control with the lowestTabIndex (usually 0).8.Since you generally want the insertion point to appear in the first control on theform, its TabIndex should be set to 0.9.The next control should be set to 1; the next to 2; and so forth. You may be puzzledby the properties of labels, which have a TabIndex property but not a TabStop.10.A label cannot receive focus, but it has a location in the tab sequence.11.This fact allows you to create keyboard access keys for text boxes.12.When the user types an access key that is in a label, such as Alt + N, the focus jumpsto the first TabIndex following the label (the text box). See figure 2.15.Figure 2.1513.By default, buttons, text boxes, and radio buttons have their TabStop property set totrue.14.Be aware that the behavior of radio buttons in the tab sequence is different fromother controls: The Tab key takes you only to one radio button in a group (theselected button), even though all buttons in the group have their TabStop andTabIndex properties set.15.If you are using the keyboard to select radio buttons, you must tab to the group andthen use your Up and Down arrow keys to select the correct button.Setting the Tab Order1.To set the tab order for controls, you can set each control’s TabIndex property in theProperties window.2.Or you can use Visual Studio’s great feature that helps you set TabIndexesautomatically.3.To use this feature, make sure that the Design window is active and select View /Tab Order or click the Tab Order button on the Layout toolbar.4.(The Tab Order item does not appear on the menu and is not available on the Layouttoolbar unless the Design window is active.)5.Small numbers appear in the upper-left corner of each control; these are the currentTabIndex properties of the controls.6.Click first in the control that you want to be TabIndex zero, then click on the controlfor TabIndex one, and then click on the next control until you have set the TabIndex for all controls (Figure 2.16).7.When you have finished setting the TabIndex for all controls, the white numberedboxes change to blue.8.Select View / Tab Order again to hide the sequence numbers or press the Esc key.9.If you make a mistake and want to change the tab order, turn the option off and onagain, and start over with TabIndex zero again, or you can keep clicking on thecontrol until the number wraps around to the desired value.Figure 2.16Setting the Form’s Location on the Screen1.When your project runs, the form appears in the upper-left corner of the screen bydefault.2.You can set the form’s screen position by setting the StartPosition property of theform.3.Figure 2.17 shows your choices for the property setting.4.To center your form on the user’s screen, set the StartPosition property toCenterScreen.Figure 2.17Creating ToolTips1.If you are a Windows user, you probably appreciate and rely on ToolTips , thosesmall labels that pop up when you pause your mouse pointer over a toolbar button or control.2.You can easily add ToolTips to your projects by adding a ToolTip component to aform.3.After you add the component to your form, each of the form’s controls has a newproperty: ToolTip on toolTip1 , assuming that you keep the default name, toolTip1, for the control. To define ToolTips, select the ToolTip tool from the toolbox (Figure2.18) and click anywhere on the form or double-click the ToolTip tool in the toolbox.4.The new control appears in the component tray that opens at the bottom of theForm Designer (Figure 2.19).5.The component tray holds controls that do not have a visual representation at runtime. You will see more controls that use the component tray later in this text.Figure 2.186.After you add the ToolTip component, examine the properties list for other controlson the form, such as buttons, text boxes, labels, radio buttons, check boxes, and even the form itself.7.Each has a new ToolTip on toolTip1 property. Try this example: Add a button to anyform and add a ToolTip component.8.Change the button’s Text property to Exit and set its ToolTip on toolTip1 propertyto Close and Exit the program .。