vb课程设计作业(VB课程设计,谁能帮帮我!!!)
本文目录
VB课程设计,谁能帮帮我!!!
一、 内容 用VB语言制作《Visual Basic语言程序设计》的教学课件。 二、说明 在所学教材中任选一章作为课件内容: 三、要求 1.课件中必须包含内容学习、例题演示、作业部分 2.内容全面、重点突出;有必要的动画演示。 3.界面友好、美观,易于操作。 4.课件演示的内容用文件保存。 四、参考书籍 《Visual Basic 使用大全》没有什么复杂的问题,随便给你一个:一个普通的计算器程序:Option ExplicitDim FirstNumber, NumberBuffer As DoubleDim chr As StringDim EnterDecimal, ScaleCodeState As BooleanDim ScaleCode As IntegerDim ScaleSymbol(0 To 7) As StringPrivate Sub Init()EnterDecimal = FalseLabel1.Caption = “0“FirstNumber = 0ScaleCode = 0ScaleCodeState = FalseLabel2.Caption = ““End SubPrivate Sub ClearAll_Click()Call InitEnd SubPrivate Sub CurrentCls_Click()Label1.Caption = ““NumberBuffer = Val(Label1.Caption)End SubPrivate Sub DecimalKey_Click()If EnterDecimal = False Then EnterDecimal = True Label1.Caption = Label1.Caption + “.“ NumberBuffer = Val(Label1.Caption)End IfEnd SubPrivate Sub Form_Load()Call InitScaleSymbol(0) = “+“ScaleSymbol(1) = “-“ScaleSymbol(2) = “*“ScaleSymbol(3) = “/“ScaleSymbol(4) = “^“ScaleSymbol(5) = “1/X“ScaleSymbol(6) = “%“ScaleSymbol(7) = “S“End SubPrivate Sub NumberKey_Click(Index As Integer)chr = Val(Index)If Left(Label1.Caption, 1) = “0“ And Mid(Label1.Caption, 2, 1) 《》 “.“ Then _Label1.Caption = Right(Label1.Caption, Len(Label1.Caption) - 1)If Len(Label1.Caption) 《 20 Then If ScaleCodeState = True Then ScaleCodeState = False Label1.Caption = ““ End If Label1.Caption = Label1.Caption + chr NumberBuffer = Val(Label1.Caption)End IfEnd SubPrivate Sub ScaleKey_Click(Index As Integer)ScaleCode = IndexEnterDecimal = FalseFirstNumber = NumberBufferScaleCodeState = TrueLabel2.Caption = ScaleSymbol(Index)End SubPrivate Sub Equal_Click()Select Case ScaleCodeCase 0NumberBuffer = FirstNumber + NumberBufferCase 1NumberBuffer = FirstNumber - NumberBufferCase 2NumberBuffer = FirstNumber * NumberBufferCase 3NumberBuffer = FirstNumber / NumberBufferCase 4NumberBuffer = FirstNumber ^ 2Case 5NumberBuffer = 1 / FirstNumberCase 6NumberBuffer = FirstNumber / 100Case 7NumberBuffer = Sqr(FirstNumber)End SelectLabel1.Caption = Str(NumberBuffer)FirstNumber = NumberBufferEnterDecimal = FalseScaleCodeState = TrueEnd SubPrivate Sub Space_Click()If Len(Label1.Caption) 》 1 ThenLabel1.Caption = Left(Label1.Caption, Len(Label1.Caption) - 1)ElseLabel1.Caption = “0“End IfNumberBuffer = Val(Label1.Caption)End Sub
VB课程设计:简单画笔的实现 VB课程设计留了这个作业,那个创新的填颜色部分不会,求指导
好麻烦哟!终于作好了!Dim Ht As BooleanPrivate Type Zb X0 As Long Y0 As LongEnd TypeDim Cszb As ZbPrivate Sub Command1_Click()Ht = TrueEnd SubPrivate Sub Command2_Click()Ht = FalseEnd SubPrivate Sub Command3_Click()Picture1.ClsEnd SubPrivate Sub Command4_Click()Dim Ys As IntegerYs = InputBox(“请填入正整数,0:黑色,1:红色,2:黄色,3:绿色,4:蓝色,》5:白色“, “设置颜色“, 0)Select Case YsCase 0 Picture1.ForeColor = &H0&Case 1 Picture1.ForeColor = &HFF&Case 2 Picture1.ForeColor = &HFFFF&Case 3 Picture1.ForeColor = &HFF00&Case 4 Picture1.ForeColor = &HFF0000Case Else Picture1.ForeColor = &HFFFFFFEnd SelectEnd SubPrivate Sub Command5_Click()Dim Kd As IntegerKd = Int(InputBox(“请输入线条宽度“, “线条宽度“, 1))If Kd 《 1 Then Kd = 1Picture1.DrawWidth = KdEnd SubPrivate Sub Command6_Click()EndEnd SubPrivate Sub Form_Load()Me.Caption = “简单画笔“Command1.Caption = “开始画图“Command2.Caption = “停止画图“Command3.Caption = “画板清空“Command4.Caption = “设置颜色“Command5.Caption = “设置宽度“Command6.Caption = “退出“Picture1.AutoRedraw = TrueHt = FalseYs = 0End SubPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Cszb.X0 = XCszb.Y0 = YEnd SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)If Ht And Button = 1 ThenPicture1.Line (Cszb.X0, Cszb.Y0)-(X, Y)Cszb.X0 = XCszb.Y0 = YEnd IfEnd Sub
更多文章:

football pitch(football pitch可以指足球场吗)
2025年2月18日 05:20

程序开发的四个步骤(在计算机上运行一个C语言编写的程序,要经过怎样的处理过程)
2025年2月19日 07:30

analyze怎么读(analyse analyze analysis的区别)
2025年3月13日 22:20

button按钮代码(javascript中,如何让button按钮处于页面最中,而不是页面上部居中,求代码,谢谢)
2025年2月20日 07:20

ubuntu怎么安装第三方软件(ubuntu14.04怎么安装)
2025年3月3日 15:30

flask restful(python web框架有哪些)
2025年3月6日 17:10

java程序员(为什么很多硬件公司的程序员都非常看不起Java程序员)
2025年2月21日 09:30

sendredirect(response没有sendRedirect方法,怎么解决)
2025年3月7日 02:00

majesty高尔夫球杆(majesty和honma哪个好)
2025年4月10日 06:10

statusstrip控件(C#里StatusStrip和StatusBar有什么不同)
2025年3月12日 01:20