




已阅读5页,还剩14页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Delphi双语实 验 指 导 书王晓红 主编河北科技大学信息科学与工程学院2007.5目 录实验(1) Getting Started with Delphi实验(2) More on Pascal实验(3) The Delphi IDE Explored实验(4) The Visual Component Model实验(5) Working with the Form Designer and the Menu Designer实验(6) VCL Components实验(7) Creating Applications;Projects, the Code Editor and the Code Explorer实验(8) Debugging Your Applications;Delphi Tools and Options实验(9) Building Database Forms;Building Database Applications实验(1) Getting Started with Delphi 实验目的:通过几个Delphi Application来熟悉Delphi 集成化开发环境。实验内容: 通过几个简单的Dephi程序来熟悉Delphi IDE环境。实验环境:操作系统:Windows 2000开发环境:Delphi 7.0实验步骤:1 Write a Windows program that displays the words Welcome to Delphi! on the window when the program runs. 2 Rewrite the program you wrote in step 1 and change the displayed text to Hello There! (Hint: You have to change only the Caption property of the Label component.) 3 Write a program that declares two variables and assign values to those variables. Multiply the two numbers together and display the result on the screen. 4 Write a program that assigns the string, There are eggs in a dozen. to a variable and then inserts the string 12 at the appropriate place in the string. Show the result in a label. 5 Write a program that creates the final result string in exercise 4, but formatted with the Format function.实验报告: 1 实验目的 2 实验内容 3 实验方法()将实验要求用Delphi语言编写并调试运行。()查看运行结果,如果结果不正确,进行修改,直到正确为止。4 实验总结 () 编译、连接、运行不成功的操作情况,分析原因,改正的过程。() 实验中的问题和提高。() 收获与体会。实验(2) More on Pascal实验目的:通过设计几个程序来掌握基本的Pascal语法。实验内容: 通过Test1、Test2之间的互调熟悉Pascal中的procedure。实验环境:操作系统:Windows 2000开发环境:Delphi 7.0实验步骤:1 Write a procedure called Test2 that changes the caption of a Label component. Put a button on a form and have the buttons OnClick handler call the Test2 procedure. 2 Take the program from exercise 1 and create another procedure called Test1 that, in turn, calls the Test2 procedure. Change the event handler of the button so that it calls Test1 rather than Test2. 3 Create a program that displays I will never talk back to my mother 20 times in a Memo component. 4 Write a record containing fields representing employee information. Include first name, last name, address, hire date, and a field indicating whether the employee is in the companys insurance plan.实验报告: 1 实验目的 2 实验内容 3 实验方法()将实验要求用Delphi语言编写并调试运行。()查看运行结果,如果结果不正确,进行修改,直到正确为止。4 实验总结 ()编译、连接、运行不成功的操作情况,分析原因,改正的过程。() 实验中的问题和提高。() 收获与体会。实验(3) The Delphi IDE Explored实验目的:通过对Delphi IDE常用组件的使用,熟悉IDE环境。实验内容: 设计并实现Delphi 不同的表单。实验环境:操作系统:Windows 2000开发环境:Delphi 7.0实验步骤:1 Remove the Pause, Step Over, and Trace Into buttons from the Delphi View toolbar. Add Compile, Build, and Syntax Check buttons to the toolbar. 2 Reset the toolbar to its default settings. 3 Spend some time looking over the components on each page of the Component palette. Place any components you are curious about on a form and experiment with them. Placing Multiple Copies of a Component. Placing and Centering a Component on the Form4 Create a new directory on your hard drive. Create a new application in Delphi. Add three new forms to the project (they can be blank if you want). Save the project to the new directory you created and run the program. Close the program. Now examine the directory where the project was saved. 5 A Multiple-Form Application. When you click the Show Form 2 button on the main form, the second form is displayed. You can close the second form by clicking the system close box on the forms title bar.6 You can now add an About box to the multiple-forms project you created earlier.7 An MDI Sample Program. This application will enable you to open and save graphics files such as bitmaps, icons, and metafiles.实验报告: 1 实验目的 2 实验内容 3 实验方法()将实验要求用Delphi语言编写并调试运行。()查看运行结果,如果结果不正确,进行修改,直到正确为止。4 实验总结 ()编译、连接、运行不成功的操作情况,分析原因,改正的过程。() 实验中的问题和提高。() 收获与体会。实验(4) The Visual Component Model 实验目的:通过应用程序熟悉控件的属性、方法和事件的使用。实验内容: 设计并实现控件的显示与隐藏程序。实验环境:操作系统:Windows 2000开发环境:Delphi 7.0实验步骤:1 Create a Delphi application that displays a bitmap on the main form when a button is clicked. 2 Create a Delphi application that displays a message box saying Hello, Bubba! When the main form is clicked. 3 Place several components of your choice on a form. Click on a component and use the Object Inspector to study that components properties. Repeat for each component on the form. 4 Switch to the Events tab and view the events of each component you placed on the form in Step 4. 5 Use frame component and understand framework. 6 Use two buttons to alternately show and hide the memo component through The Sender Parameter.实验报告: 1 实验目的 2 实验内容 3 实验方法()将实验要求用Delphi语言编写并调试运行。()查看运行结果,如果结果不正确,进行修改,直到正确为止。4 实验总结 ()编译、连接、运行不成功的操作情况,分析原因,改正的过程。() 实验中的问题和提高。() 收获与体会。实验(5) Working with the Form Designer and the Menu Designer实验目的:通过制作应用程序来了解表单和菜单的设计。实验内容: 设计并实现带菜单的应用程序。实验环境:操作系统:Windows 2000开发环境:Delphi 7.0实验步骤:1 Place five edit components on a form and arrange them so that they are stacked vertically with their left edges aligned. 2 Turn the Snap to Grid option off (choose Tools | Environment Options from the main menu). Place five controls of your choice on a form and align their right edges. 3 Place a ListBox component on a blank form and modify it so that it always occupies the forms entire client area. 4 Add an About box to the ScratchPad program. Use the Alignment palette to quickly align the text labels. 5 Add an Undo item and a menu separator to the context menu for the ScratchPad program. 6 Start a new application. Place six edit components on a form in random fashion. Now arrange the tab order so that tabbing proceeds from top to bottom. Run the program to test the tabbing order. 7 Add the Ctrl+S keyboard shortcut to the File | Save menu item in the ScratchPad program. 8 Open the Picture Viewer project you created . Remove all unused menu items.实验报告: 1 实验目的 2 实验内容 3 实验方法()将实验要求用Delphi语言编写并调试运行。()查看运行结果,如果结果不正确,进行修改,直到正确为止。4 实验总结 ()编译、连接、运行不成功的操作情况,分析原因,改正的过程。() 实验中的问题和提高。() 收获与体会。实验(6) VCL Components实验目的:通过制作应用程序来熟悉VCL常用控件的使用。实验内容: 设计带有 list box,RadioGroup,edit,label, button的应用程序。实验环境:操作系统:Windows 2000开发环境:Delphi 7.0实验步骤:1 Create a program that contains two edit components. When the user types information in the first control, make it appear in the second edit control as it is entered. 2 Create a program with a list box. Write code to load the list box from a text file prior to the application being visible. 3 Add an edit component to the program in Exercise 2. When the user selects an item in the list box, have the items text appear in the edit control. 4 Add a button to the program in Exercises 2 and 3. Write code so that when the button is clicked, any text in the edit control is added as a new item in the list box. 5 Create a program that has a RadioGroup with four items in the group. Add a label component whose text changes depend on which radio button is clicked. 实验报告: 1 实验目的 2 实验内容 3 实验方法()将实验要求用Delphi语言编写并调试运行。()查看运行结果,如果结果不正确,进行修改,直到正确为止。4 实验总结 ()编译、连接、运行不成功的操作情况,分析原因,改正的过程。() 实验中的问题和提高。() 收获与体会。实验指导书。实验(7)Creating Applications;Projects, the Code Editor and the Code Explorer实验目的:通过制作一个具有多窗口的应用程序来了解MDI应用程序的设计。实验内容: 设计并实现一个Delphi MDI应用程序。实验环境:操作系统:Windows 2000开发环境:Delphi 7.0实验步骤:1 Create a new form. Add several components of your choosing to the form. Save the form to the Forms page of the Object Repository with the name BaseForm. 2 Start a new application. Choose File | New to view the Object Repository. Switch to the Forms page. Click the Inherit radio button. Choose the BaseForm object you created in exercise 1 and add it to the application. (Be sure you used the Inherit option.) Save the project and close it. 3 Open the BaseForm object you created in exercise 1. Delete all components on the form and save the form. 4 Reopen the project you created in exercise 2. Display the new form you created in that exercise. Note that the components are all gone. (Remember, you inherited this object, so all changes made to the base form were also made to the inherited form.) 5 Choose Tools | Repository from the main menu. Delete the BaseForm created earlier. 6 Create a project using the Application Wizard. Use all menu options and make the application an MDI application. 7 Add a multipage dialog box to the application you created in exercise 6. Use the Dialog Wizard. 8 Use the Object Repository to add an About box to the program you created in exercise. 实验报告: 1 实验目的 2 实验内容 3 实验方法()将实验要求用Delphi语言编写并调试运行。()查看运行结果,如果结果不正确,进行修改,直到正确为止。4 实验总结 ()编译、连接、运行不成功的操作情况,分析原因,改正的过程。() 实验中的问题和提高。() 收获与体会。实验(8) Debugging Your Applications;Delphi Tools and Options实验目的:通过使用Debugging 工具,了解Delphi的调试技巧。实验内容: 使用Delphi的Debugging 工具,并实现一个Component Palette画布。实验环境:操作系统:Windows 2000开发环境:Delphi 7.0实验步骤:procedure TForm1.Button1Click(Sender: TObject);var S : string; X, Y : Integer;begin X := Width; S := IntToStr(X); Y := Height; X := X * Y;S := IntToStr(X); X := X div Y; S := IntToStr(X); Width := X; Height := Y;end;1 Create a new application and place a button on the form. Change the buttons Name property to WatchBtn and its Caption to Watch Test. Change the forms Name property to DebugMain and the Caption property to whatever you like. 2 Load the DebugTst program you created earlier in this chapter. Place a breakpoint in the WatchBtnClick method. Add the S and X variables to the Watch List. Add each variable to the Watch List four times. Edit each of the watches and change the display options. Run the program and step through the method to see the effects in the Watch List. 3 Add a conditional breakpoint to the method in exercise 3. Place it on the line immediately after the line that reads X := Width. Make the condition X = 0 and run the program. What happens? (Nothing happens because the value of X never reaches 0.) 4 Continuing with exercise 3, edit the breakpoint and change the condition to X 400. Run the program. Change the windows size and click the Watch Test button. Repeat this process several times, changing the windows size each time. What happens? (This t
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 医院消防常识考试试题及答案
- 思想精神面试题及答案
- 2025年福建法院招聘聘用制书记员考试笔试试题(含答案)
- 预防接种培训测试题及答案
- 2025年建筑“钢筋工”岗位职业技能资格知识考试题库与答案
- 医技人员三基考试试题(附答案)
- 医院消毒试题(附答案)
- 北京汽修知识培训课件
- 2025年施工员之装修施工基础知识考试题库(含答案)
- 2024年四川公务员考试《行测》真题及答案
- 2025至2030年中国酒店布草行业市场全景评估及投资前景展望报告
- (2025年标准)供暖采暖协议书
- 2025年应急管理普法知识竞赛历年参考题库含答案详解(5套)
- 2025至2030中国非标自动化行业发展趋势分析与未来投资战略咨询研究报告
- 2025年小学生爱粮节粮科普知识竞赛试题(含答案)
- 2025驾驶员安全教育培训考试试卷(及答案)
- 2025年广西公需真题卷及答案
- 2025-2026(一)秋季第一学期德育活动安排表
- 图解自然资源部《自然资源领域数据安全管理办法》
- 2023年烟台蓝天投资开发集团有限公司招聘笔试题库及答案解析
- 商场开荒保洁计划书
评论
0/150
提交评论