拜托,先谢谢了
Rem 窗体内添加两个Frame控件,Frame1表示距离,内添加option1表示<1000,option2表示>1000 Rem Frame2表示类型,option3表示普通,option4表示挂号 Rem text1输入物品重量,commandbutton1计算应收费用,label2显示应收费用 Option Explicit Dim T1, T2, T3, T4 As Single Dim SF As Single Dim ZL As Single
Private Sub Command1_Click() ZL = Val(Text1.Text) If ZL <= 30 Then If Option1.Value = True Then If Option3.Value = True Then SF = T1 * ZL Else SF = T2 * ZL End If Else If Option3.Value = True Then SF = T3 * ZL Else SF = T4 * ZL End If End If Else If Option1.Value = True Then If Option3.Value = True Then SF = T1 * ZL + (ZL - 30) * 0.5 Else SF = T2 * ZL + (ZL - 30) * 0.5 End If Else If Option3.Value = True Then SF = T3 * ZL + (ZL - 30) * 0.5 Else SF = T4 * ZL + (ZL - 30) * 0.5 End If End If End If Label2.Caption = "应收费用为:" + Str(SF) End Sub
Private Sub Form_Load() T1 = 2: T2 = 3: T3 = 2.5: T4 = 3.5 End Sub