《VB环境和可视化编程基础实验报告(共5页).doc》由会员分享,可在线阅读,更多相关《VB环境和可视化编程基础实验报告(共5页).doc(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、精选优质文档-倾情为你奉上实验题目VB.NET环境和可视化编程基础小组合作否姓名班级学 号一、实验目的1、了解VB.NET系统对计算机软、硬件的要求。2、掌握启动与退出VB.NET的方法。3、掌握建立、编辑和运行一个简单的VB.NET应用程序的全过程。4、掌握常用控件文本框、标签、命令按钮、图片框的使用。二实验环境VB.NET和相关硬件三、实验内容与步骤1、 创建一个“windows应用程序”类型的应用程序,要求在屏幕上显示“欢迎学习VB.NET”,在文本框中输入你的姓名,在标签中显示输入的姓名。2、 编一个程序,在文本框中统计该窗口上鼠标单击的次数。3、 对窗体三个事件过程(Load、Cli
2、ck、DoubleClick)编程,三个事件中装入不同的图片。按钮、字号、内容和格式的复制练习。四、实验过程与分析一、Public Class 一_1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox2.Text = TextBox1.Text If TextBox1.Text = Then MsgBox(请输入姓名, 0) TextBox1.Focus() End If End Sub Private Sub 一
3、_1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End SubEnd Class二、Public Class 一_3 Sub 一_3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Click TextBox1.Text = Val(TextBox1.Text) + 1 End Sub End Class三、Public Class 一_4 Private
4、 Sub 一_4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Text = 装入窗体 Me.BackgroundImage = Image.FromFile(一-4a.jpg) Me.BackgroundImageLayout = ImageLayout.Stretch End Sub Sub 一_4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.C
5、lick Me.Text = 单击窗体 Me.BackgroundImage = Image.FromFile(一-4b.jpg) Me.BackgroundImageLayout = ImageLayout.Stretch Me.MaximizeBox = True Me.MinimizeBox = True End Sub Sub 一_4_doubleclick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.DoubleClick Me.Text = 双击窗体 Me.MaximizeBo
6、x = False Me.MinimizeBox = False Me.BackgroundImage = Nothing Me.FormBorderStyle = Windows.Forms.FormBorderStyle.Fixed3D Me.Cursor = Cursors.Default End SubEnd Class四、Public Class 一_5 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1
7、.Font = New Font(隶书, 25) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox1.Font = New Font(幼圆, 15) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TextBox1.Text = Then MsgBox(请输入文本) Else If (TextBox1.SelectedText = ) Then MsgBox(请选择要复制的文字) Else TextBox2.Text = TextBox1.SelectedText TextBox2.Font = TextBox1.Font End If End If End Sub End Class五、实验总结通过本次的实验对VB.NET有了初步的了解,并经过几个简单的程序后使对其有了一定的应用。专心-专注-专业