返回列表 回復 發帖

寫程式問題..急

我想寫只要在LISTBOX點一下A/B/C 就會*0.7
如果係VIPCustomers + 點了A/B/C就會 0.9*0.7
剛剛自己試左試 但係一係就*0.9 一係就*0.7 唔識點樣一齊乘
希望各位可以幫幫我 THANK YOU

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim VIPCustomers() As String = {"JOE", "JOHN"}
        Dim PromotionItem() As String = {"A", "B", "C"}

        Dim myProduct As String
        Dim CustomerExist As Boolean
        Dim ItemExist As Boolean
        Dim num As Integer

        myProduct = ListBox1.SelectedItem

        CustomerExist = False
        num = 0
        
        Do While num < 4
            If TextBox1.Text = VIPCustomers(num) Then
                CustomerExist = True
            End If
            num = num + 1
        Loop

        If CustomerExist = True Then
            TextBox3.Text = CInt(TextBox2.Text) * 0.9
        Else
            TextBox3.Text = CInt(TextBox2.Text)  *10

        End If

    End Sub
End Class
你嘅 TextBox2 裝住啲乜嘢?
返回列表