




已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
VERSION 5.00Begin VB.Form Form1 Caption = 求解一元二次方程 ClientHeight = 3360 ClientLeft = 555 ClientTop = 1155 ClientWidth = 5760 KeyPreview = -1 True LinkTopic = Form1 ScaleHeight = 3360 ScaleWidth = 5760 Begin VB.CommandButton Command2 Caption = 清 空(F2) Height = 375 Left = 3480 TabIndex = 12 Top = 2760 Width = 1695 End Begin VB.CommandButton Command1 Caption = 运 算(F1) Height = 375 Left = 600 TabIndex = 11 Top = 2760 Width = 1695 End Begin VB.TextBox Text3 BeginProperty Font Name = 宋体 Size = 10.5 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 375 Left = 4200 TabIndex = 6 Top = 720 Width = 1335 End Begin VB.TextBox Text2 BeginProperty Font Name = 宋体 Size = 10.5 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 375 Left = 2400 TabIndex = 5 Top = 720 Width = 1335 End Begin VB.TextBox Text1 BeginProperty Font Name = 宋体 Size = 10.5 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 375 Left = 480 TabIndex = 4 Top = 720 Width = 1335 End Begin VB.Label Label10 BeginProperty Font Name = 宋体 Size = 10.5 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 615 Left = 600 TabIndex = 14 Top = 1680 Visible = 0 False Width = 5055 End Begin VB.Label Label9 Caption = x= BeginProperty Font Name = 宋体 Size = 10.5 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 375 Left = 120 TabIndex = 13 Top = 1680 Visible = 0 False Width = 375 End Begin VB.Label Label8 BeginProperty Font Name = 宋体 Size = 10.5 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 615 Left = 600 TabIndex = 10 Top = 2040 Width = 5055 End Begin VB.Label Label7 BeginProperty Font Name = 宋体 Size = 10.5 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 615 Left = 600 TabIndex = 9 Top = 1320 Width = 5055 End Begin VB.Label Label6 Caption = x2= BeginProperty Font Name = 宋体 Size = 10.5 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 375 Left = 120 TabIndex = 8 Top = 2040 Width = 375 End Begin VB.Label Label5 Caption = x1= BeginProperty Font Name = 宋体 Size = 10.5 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 375 Left = 120 TabIndex = 7 Top = 1320 Width = 375 End Begin VB.Label Label4 Caption = c: BeginProperty Font Name = 宋体 Size = 10.5 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 375 Left = 3960 TabIndex = 3 Top = 720 Width = 255 End Begin VB.Label Label3 Caption = b: BeginProperty Font Name = 宋体 Size = 10.5 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 375 Left = 2040 TabIndex = 2 Top = 720 Width = 255 End Begin VB.Label Label2 Caption = a: BeginProperty Font Name = 宋体 Size = 10.5 Charset = 134 Weight = 400 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty Height = 375 Left = 240 TabIndex = 1 Top = 720 Width = 240 End Begin VB.Label Label1 Caption = 求解一元二次方程 BeginProperty Font Name = 隶书 Size = 15.75 Charset = 134 Weight = 700 Underline = 0 False Italic = 0 False Strikethrough = 0 False EndProperty ForeColor = &H00800000& Height = 375 Left = 1560 TabIndex = 0 Top = 180 Width = 2850 EndEndAttribute VB_Name = Form1Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalsePrivate Sub Form_load()Command1.Caption = 运 算(F1) 这两句代码是防止此程序在其他电脑上运行时按钮上的字幕只显示第一个字。Command2.Caption = 清 空(F2)End SubPrivate Sub Command1_Click()Dim a, b, c, d, x, x1, x2, realpart, imagpart As Double 若将x1,x2,x定义为String,则当修复-1x1(或x2或x)0或0x1(或x2或x) 0 Then x1 = (-b + Sqr(d) / (2 * a) x2 = (-b - Sqr(d) / (2 * a) If x1 0 And Left(Str(x1), 1) = . Then 当0x11时,显示出小数点前的0(在VB的默认条件下,整数部分的“0”不显示)。 x1 = 0 & x1 这里采用字符串拼接的方法解决这一问题 End If If x1 0 And Mid(Str(x1), 2, 1) = . Then 当-1x1 0 And Left(Str(x2), 1) = . Then 同上。 x2 = 0 & x2 End If If x2 0 And Left(Str(x), 1) = . Then 同上。 x = 0 & x End If If x 0 And Mid(Str(x), 2, 1) = . Then x = -0 & Abs(x) End If Label5.Visible = False Label6.Visible = False Label7.Visible = False Label8.Visible = False Label9.Visible = True Label10.Visible = True Label10.Caption = x End If If d O And Left(Str(realpart), 1) = . Then If Abs(imagpart) = 1 Then Label7.Caption = 0 & Str(realpart) & +i Label8.Caption = 0 & Str(realpart) & -i Else If Left(Str(Abs(imagpart), 1) = . Then Label7.Caption = 0 & Str(realpart) & + & Format(Abs(imagpart), 0.#) & i Label8.Caption = 0 & Str(realpart) & - & Format(Abs(imagpart), 0.#) & i Else Label7.Caption = 0 & Str(realpart) & + & Str(Abs(imagpart) & i Label8.Caption = 0 & Str(realpart) & - & Str(Abs(imagpart) & i End If End If Else If realpart 0 And Mid(Str(realpart), 2, 1) = . Then If Abs(imagpart) = 1 Then Label7.Caption = -0 & Str(Abs(realpart) & +i Label8.Caption = -0 & Str(Abs(realpart) & -i Else If Left(Str(Abs(imagpart), 1) = . Then Label7.Caption = -0 & Str(Abs(realpart) & + & Format(Abs(imagpart), 0.#) & i Label8.Caption = -0 & Str(Abs(realpart) & - & Format(Abs(imagpart), 0.#) & i Else Label7.Caption = -0 & Str(Abs(realpart) & + & Str(Abs(imagpart) & i Label8.Caption = -0 & Str(Abs(realpart) & - & Str(Abs(imagpart) & i End If End If Else If Abs(imagpart) = 1 Then Label7.Caption = Str(Abs(realpart) & +i Label8.Caption = Str(Abs(realpart) & -i Else If Left(Str(Abs(imagpart), 1) = . Then Label7.Caption = Str(Abs(realpart) & + & Format(Abs(imagpart), 0.#) & i Label8.Caption = Str(Abs(realpart) & - & Format(Abs(imagpart), 0.#) & i Else Label7.Caption = Str(Abs(realpart) & + & Str(Abs(imagpart) & i Label8.Caption = Str(Abs(realpart) & - & Str(Abs(imagpart) & i End If End If End If End If End If End IfEnd IfEnd SubPrivate Sub Command2_Click()Text1.Text = Text2.Text = Text3.Text = Label7.Caption = Label8.Caption = Label5.Visible = TrueLabel6.Visible = TrueLabel7.Visible = TrueLabel8.Visible = TrueLabel9.Visible = FalseLabel10.Visible = FalseText1.SetFocusEnd SubPrivate Sub Form_Resize() 阻止用户任意改变窗体大小。If Me.WindowState = 0 Then 当窗体窗口运行时的课件状态为正常状态时才起作用,保证最大化的正常运行。
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025-2030攀岩吊带行业技术路线图制定与创新资源分配优化方案
- 2025-2030抗衰老生物技术前沿进展与资本介入时机选择研究
- 2025-2030抗痛风药物行业竞争策略与增长潜力研究报告
- 2025-2030抗体药物偶联物linker技术优化与联合用药方案设计报告
- 2025-2030慢性病远程监测设备家庭普及率影响因素深度调研
- 2025-2030微生物组移植对发育迟缓儿童的临床疗效观察
- 2025-2030律师行业数字化转型路径与实践案例
- 2025-2030律师行业声誉管理与社会形象塑造战略报告
- 2025-2030律师事务所行业跨界合作与生态圈建设策略研究
- 2025-2030律师事务所行业知识管理与经验传承调研报告
- 大学生研究生就业方案
- 期末复习(课件)新思维英语四年级上册
- 子宫脱垂试题及答案
- GB/T 90.1-2023紧固件验收检查
- 中国政治思想史复习资料
- 2023年度广东省成人高考《英语》(高升本)真题库及答案(单选题型)
- 《中国民间故事》阅读指导课
- LY/T 2501-2015野生动物及其产品的物种鉴定规范
- EPON关键技术及实现原理
- 肢体残疾的标准及康复课件
- 种植手术导板的制作流程课件
评论
0/150
提交评论