vb编个计算机,怎么样用VB语言编制一个电脑中的附件,如写字板,计算器,画图等请把代码加上,急用!!!...

Dim myflag%, myjudge%, response%

'禁止改变窗体大小代码开始

Dim oldw&, oldh&

Private Sub Form_Load()

oldw = Me.Width: oldh = Me.Height

Timer1.Interval = 200

'数据初始化

myflag = 1

myjudge = 0

End Sub

Private Sub Form_Resize()

Me.Width = oldw: Me.Height = oldh

End Sub

'禁止改变窗体大小代码结束

'运算符设置

Private Sub Command0_Click(index As Integer)

If index = 0 Then

Text4.Text = "+"

ElseIf index = 1 Then

Text4.Text = "-"

ElseIf index = 2 Then

Text4.Text = "×"

ElseIf index = 3 Then

Text4.Text = "/"

ElseIf index = 4 Then

Text4.Text = "√"

Text5.Text = ""

Text1.Text = ""

ElseIf index = 5 Then

Text4.Text = "^"

ElseIf index = 6 Then

Text4.Text = "Mod"

End If

myflag = -1

End Sub

'数值键命令

Private Sub Command1_Click(index As Integer)

If myjudge = 1 Then

Text1.Text = ""

Text3.Text = ""

Text4.Text = ""

Text5.Text = ""

End If

If myflag > 0 Then

Text3.Text = CStr(Text3.Text) & CStr(index)

myjudge = 2

Text1.Text = ""

Text4.Text = ""

Text5.Text = ""

ElseIf myflag 

Text5.Text = CStr(Text5.Text) & CStr(index)

If Text4.Text = "/" And Val(Text5.Text) = 0 Then

response = MsgBox("分母不能为零!", vbOKOnly + vbExclamation + vbDefaultButton1, "注意!")

Text5.Text = ""

ElseIf Text4.Text = "Mod" And Val(Text5.Text) = 0 Then

response = MsgBox("分母不能为零!", vbOKOnly + vbExclamation + vbDefaultButton1, "注意!")

Text5.Text = ""

End If

End If

End Sub

Private Sub Command3_Click()

If myflag > 0 Then

Text3.Text = CStr(Text3.Text) & "."

End If

If myflag 

Text5.Text = CStr(Text5.Text) & "."

End If

End Sub

'计算代码

Private Sub myjs()

If Text4.Text = "+" Then

If Val(Text3.Text) + Val(Text5.Text)  0 Then

Text1.Text = CStr(Val(Text3.Text) + Val(Text5.Text))

Else

Text1.Text = Val(CStr(Val(Text3.Text) + Val(Text5.Text)))

End If

ElseIf Text4.Text = "-" Then

If Val(Text3.Text) - Val(Text5.Text)  0 Then

Text1.Text = CStr(Val(Text3.Text) - Val(Text5.Text))

Else

Text1.Text = Val(CStr(Val(Text3.Text) - Val(Text5.Text)))

End If

ElseIf Text4.Text = "×" Then

If Val(Text3.Text) * Val(Text5.Text)  0 Then

Text1.Text = CStr(Val(Text3.Text) * Val(Text5.Text))

Else

Text1.Text = Val(CStr(Val(Text3.Text) * Val(Text5.Text)))

End If

ElseIf Text4.Text = "/" Then

If Val(Text3.Text) / Val(Text5.Text)  0 Then

Text1.Text = CStr(Val(Text3.Text) / Val(Text5.Text))

Else

Text1.Text = Val(CStr(Val(Text3.Text) / Val(Text5.Text)))

End If

ElseIf Text4.Text = "Mod" Then

If Val(Text3.Text) Mod Val(Text5.Text)  0 Then

Text1.Text = CStr(Val(Text3.Text) Mod Val(Text5.Text))

Else

Text1.Text = Val(CStr(Val(Text3.Text) Mod Val(Text5.Text)))

End If

ElseIf Text4.Text = "^" Then

If Val(Text3.Text) ^ Val(Text5.Text)  0 Then

Text1.Text = CStr(Val(Text3.Text) ^ Val(Text5.Text))

Else

Text1.Text = Val(CStr(Val(Text3.Text) ^ Val(Text5.Text)))

End If

ElseIf Text4.Text = "√" Then

If Val(Text3.Text) ^ 0.5  0 Then

Text1.Text = CStr(Val(Text3.Text) ^ 0.5)

Else

Text1.Text = Val(Text3.Text) ^ 0.5

End If

End If

End Sub

'求值

Private Sub Label3_Click()

Call myjs

myflag = 1

myjudge = 1

End Sub

Private Sub Text3_GotFocus()

Text3.ToolTipText = Text3.Text

End Sub

Private Sub Text5_GotFocus()

Text5.ToolTipText = Text5.Text

End Sub

Private Sub Text1_GotFocus()

Text1.ToolTipText = Text1.Text

End Sub

Python网络爬虫与推荐算法新闻推荐平台:网络爬虫:通过Python实现新浪新闻的爬取,可爬取新闻页面上的标题、文本、图片、视频链接(保留排版) 推荐算法:权重衰减+标签推荐+区域推荐+热点推荐.zip项目工程资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松复刻,拿到资料包后可轻松复现出一样的项目,本人系统开发经验充足(全领域),有任何使用问题欢迎随时与我联系,我会及时为您解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明(如有)等。答辩评审平均分达到96分,放心下载使用!可轻松复现,设计报告也可借鉴此项目,该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的。 【提供帮助】:有任何使用问题欢迎随时与我联系,我会及时解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 【项目价值】:可用在相关项目设计,皆可应用在项目、毕业设计、课程设计、期末/期/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 下载后首先打开README文件(如有),项目工程可直接复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用。
1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值