实验报告11 实验报告2: 实验题目1:设计窗体
参考界面如下: 运行前 运行后 要求: 1) 在窗体上添加一个标签,通过属性窗囗设置标签格式: Caption:字体格式 Alignment:2—Center(居中) BorderStyle :1—Fixed Single(有边框) Backstyle:0—Tansparent(背景透明) 2) 运行时,单击“字号”,将标签内容的字号设置为 30;单击“加粗”,将标签内容加粗;单击“下划线”,则在标签内容下加下划线
提示:字号 FontSize、加粗 FontBold、下划线 FontUnderline 实验题目1 源程序代码: Private Sub Command1_Click() Label1
FontSize = 30 End Sub Private Sub Command2_Click() Label1
FontBold = true End Sub Private Sub Command3_Click() Label1
FontUnderline = True End Sub 实验题目2: 设计一个计算器
参考界面如下: 要求: 1)实现算术运算(+、-、*、/)的功能; 2)实现清除和结束的功能; 3)实现清除后,将焦点移到第一个文本框中
实验题目 2 源程序代码: Private Sub Command1_Click() Text3
Text = Val(Text1
Text) + Val(Text2
Text) End Sub Private Sub Command2_Click() Text3
Text = Val(Text1
Text) - Val(Text2
Text) End Sub Private Sub Command3_Click() Text3
Text = Val(Text1