2008-06-05 15:08:30楓落無情

VB估價單

Dim Total As Long
Private Sub cmdCalculate_Click()
Total = 0
Select Case cboCPU.ListIndex
Case 0
Total = Total + 2200
Case 1
Total = Total + 5800
Case 2
Total = Total + 7500
Case 3
Total = Total + 3250
Case Else
MsgBox ”CPU未選,請確認!”, vbInformation, ”請確認”
End Select
Select Case cboMainBoard.ListIndex
Case 0
Total = Total + 4750
Case 1
Total = Total + 3750
Case 2
Total = Total + 3650
Case 3
Total = Total + 3350
Case Else
MsgBox ”主機板未選,請確認!”, vbInformation, ”請確認”
End Select
If optRAM(0).Value = True Then Total = Total + 1250
If optRAM(1).Value = True Then Total = Total + 2000
If optRAM(2).Value = True Then Total = Total + 4100

If optMonitor(0).Value = True Then Total = Total + 4500
If optMonitor(1).Value = True Then Total = Total + 9300
If optMonitor(2).Value = True Then Total = Total + 15500

If optCDROM(0).Value = True Then Total = Total + 1500
If optCDROM(1).Value = True Then Total = Total + 1900
If optCDROM(2).Value = True Then Total = Total + 2400

If optHDD(0).Value = True Then Total = Total + 3500
If optHDD(1).Value = True Then Total = Total + 3700
If optHDD(2).Value = True Then Total = Total + 4200

If optPrinter(0).Value = True Then Total = Total + 5700
If optPrinter(1).Value = True Then Total = Total + 6200
If optPrinter(2).Value = True Then Total = Total + 10500

If chkModem.Value = True Then Total = Total + 1950
If chkDVD.Value = True Then Total = Total + 4200

If chkDIY.Value = False Then Total = Total + 1500

lblTotal = Total
End Sub

Private Sub Form_Load()
cboCPU.AddItem ”Pentium III-300”
cboCPU.AddItem ”Pentium III-350”
cboCPU.AddItem ”Pentium III-400”
cboCPU.AddItem ”K6-2 400”

cboMainBoard.AddItem ”ASUS”
cboMainBoard.AddItem ”GIGA”
cboMainBoard.AddItem ”SOYO”
cboMainBoard.AddItem ”Aopen”
End Sub