欢迎来到天天文库
浏览记录
ID:2084618
大小:187.50 KB
页数:17页
时间:2017-11-14
《vb计算器实训 实验报告》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、江西科技师范大学实验报告2010年级计算机科学与技术1班学号姓名实验日期201003成绩实训8实验报告一、实验目的:制作一个计算器二、实验进程:完成了十六进制,八进制的代码书写。添加了form3,完成了窗体转化。三、实验原理与分析:1、控件属性设置:Form1:控件属性Command1Caption0Command1Index0Command2Caption+Command2Index0Command3Caption+/-Command3Font加粗Command4Caption.Command4font加粗Command5Cap
2、tionBackspaceCommand5Font加粗Command6CaptionCCommand6Font加粗Command7CaptionCECommand7Font加粗Command8CaptionSqrtCommand9Caption1/xCommand10Caption%Command11Caption=Command11Font加粗Text1Text0.Text1Alignment1-rightjustifyText1Font四号Form1Caption计算器Form1MaxbuttonFalseForm2:控件属性
3、Command1Caption0Command1Index0Command2Caption+Command2Index0Command3Caption+/-指导教师:郝谦第17页共17页江西科技师范大学实验报告2010年级计算机科学与技术1班学号姓名实验日期201003成绩Command3Font加粗Command4Caption.Command4font加粗Command5CaptionBackspaceCommand5Font加粗Command6CaptionCCommand6Font加粗Command7CaptionCECo
4、mmand7Font加粗Command8CaptionSqrtCommand9Caption1/xCommand10Caption%Command11Caption=Command11Font加粗Command12captionsinCommand12index0Command13captionACommand13index0Command13enabledfalseText1Text0.Text1Alignment1-rightjustifyText1Font四号Form2Caption计算器Frame1Caption“”Fra
5、me2Caption“”Option1Caption十六进制Option2Caption八进制Option3caption十进制Option4caption二进制Form2MaxbuttonFalseForm3:控件属性Command1Caption确定Image1StretchTrueForm3Caption帮助主题Form3MaxbuttonFalse2、界面图:Form1指导教师:郝谦第17页共17页江西科技师范大学实验报告2010年级计算机科学与技术1班学号姓名实验日期201003成绩Form2:Form3:指导教师:郝谦
6、第17页共17页江西科技师范大学实验报告2010年级计算机科学与技术1班学号姓名实验日期201003成绩3、代码书写:Form1:OptionExplicitDimiAsIntegerDimjAsIntegerDimmAsStringDimx1AsDoubleDimx2AsDoubleDimyAsStringDimopAsIntegerDimlastinputAsStringPrivateSubAbout_Click()Form1.HideForm3.ShowEndSubPrivateSubCommand1_Click(Index
7、AsInteger)输入数字0-9IfText1.Text="0."Orlastinput="="ThenText1.Text=Indexlastinput="number"Else指导教师:郝谦第17页共17页江西科技师范大学实验报告2010年级计算机科学与技术1班学号姓名实验日期201003成绩IfForm1.Tag<>""ThenIfIndex=10ThenText1.Text="0."ElseText1.Text=Command1(Index).CaptionEndIfForm1.Tag=""ElseText1.Text=
8、Text1.Text&Command1(Index).CaptionEndIflastinput="number"EndIfEndSubPrivateSubCommand10_Click()Text1.Text=Format(Text1.Text/
此文档下载收益归作者所有