Board logo

標題: 寫程式問題..急 [打印本頁]

作者: 64276064    時間: 2012-2-27 12:21 PM     標題: 寫程式問題..急

我想寫只要在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
作者: sklamx    時間: 2012-3-3 09:46 AM

你嘅 TextBox2 裝住啲乜嘢?




歡迎光臨 公仔箱論壇 (http://www3.tvboxnow.com/) Powered by Discuz! 7.0.0