怎样用VB编像计算器这样的程序呀?
Private Sub Command1_Click() Dim x As Single, y As Single x = Text1。Text y = Text2。Text Text1。Text = Val(Text1。Text) Text2。
Text = Val(Text2。Text) If Option1。Value = True Then Text3。Text = x + y Text3。Text = Str(Text1。Text) + "+" + Str(Text2。
Text) + "=" + Text3。Text End If If Option2。Value = True Then Text3。Text = x - y Text3。Text = Str(Text1。Text) + "-" + Str(Text2。
Text) + "=" + Text3。Text End If If Option3。Value = True Then Text3。Text = x * y Text3。Text = Str(Text1。Text) + "×" + Str(Text2。
Text) + "=" + Text3。Text End If If Option4。Value = True Then Text3。Text = x / y Text3。Text = Str(Text1。Text) + "÷" + Str(Text2。
Text) + "=" + Text3。Text End If End Sub Private Sub Command2_Click() Text1。Text = "" Text2。Text = "" Text3。Text = "" Option1。
Value = False Option2。Value = False Option3。Value = False Option4。Value = False End Sub Private Sub Command3_Click() End End Sub。
这还用说吗? 需要学习basic语言~~~
需要学习basic语言
Dim Num1, Num2 As Single Dim StrNum1, StrNum2 As String Dim FirstNum As Boolean '判断是否是数字开头 Dim PointFlag As Boolean '判断是否已有小数点 Dim Runsign As Integer '储存运算符号 Dim SignFlag As Boolean '判断是否已有运算符号 Sub ClearData() Num1 = 0 Num2 = 0 StrNum1 = "" StrNum2 = "" FirstNum = True PointFlag = False Runsign = 0 SignFlag = False Text1。
Text = "0。" End Sub Sub Run() Num1 = Val(StrNum2) Num2 = Val(StrNum1) Select Case Runsign Case 1 equal = Num1 + Num2 Case 2 equal = Num1 - Num2 Case 3 equal = Num1 * Num2 Case 4 equal = Num1 / Num2 End Select StrNum2 = Str(equal) StrNum1 = StrNum2 Text1。
Text = StrNum2 End Sub Private Sub about_Click() MsgBox "Create by 周晓阳。1998/7/27", vbDefaultButton1, "VB教程第四章范例" End Sub Private Sub Command1_Click(Index As Integer) Select Case Index Case 0 To 9 If FirstNum Then StrNum1 = Str(Index) FirstNum = False Else StrNum1 = StrNum1 + Str(Index) End If Text1。
Text = StrNum1 Case 10 If Not PointFlag Then If FirstNum Then StrNum1 = "0。" FirstNum = False Else StrNum1 = StrNum1 + "。
" End If Else Exit Sub End If PointFlag = True Text1。Text = StrNum1 Case 12 To 15 FirstNum = True PointFlag = False '还原标记值 If SignFlag Then Call Run Else SignFlag = True StrNum2 = StrNum1 StrNum1 = "" End If Runsign = Index - 11 Case 11 If Not SignFlag Then Text1。
Text = StrNum1 equal = Val(StrNum1) FirstNum = True PointFlag = False Else Call Run SignFlag = False End If Case Else Call ClearData End Select End Sub Private Sub Form_Load() Call ClearData End Sub 。
答:线性链表分好几种,分为单链,双链等,它们的存储顺序也不一样. 线性表是顺序存储的,占顺序的存储空间详情>>
问:电脑安装了VB6.0,为什么打开方式里面没有VB程序选项,进安装好的VB里去关联...
答:打开方式最下面还有一个《选择程序》,点开后查VB的安装目录的EXE,找到后直接打开,下次就会在打开方式里查到了详情>>