อยากทราบวิธีการหยุด randomize.. รบกวนด้วยคับ
Private Sub Timer_Timer() lbltime.Caption = Now() Dim Total As Double Dim Final As Double Dim Qty As Integer b = 0 If b < 1 Then a = Int(Rnd(99) * VsQty.Value) 'VsQty = VScroll lstProduce.AddItem a lstCost.AddItem txtCost lstTotalCost.AddItem a * txtCost Cost = txtCost * a 'Cost of lstCost*lstProduce End If Total = 0 Qty = 0 i = 0 While i < lstProduce.ListCount
i = i + 1 Total = Total + lstProduce.List(lstProduce.ListIndex + i) * lstCost.List(lstCost.ListIndex + i) txtCostProduce.Text = Total 'to count the amt of qty produced Qty = Qty + lstProduce.List(lstProduce.ListIndex + i) txtQtyProduce.Text = Qty If Qty > 50 Then i = i + lstProduce.ListCount Rnd = 0 End If Wend End Sub
---------------------------------------------------------------- ทีนี้ถ้าหากว่า Qty > 50 อยากจะทำให้มันหยุด random number ใน lstProduce อะคับ.. แต่ถ้าหากว่าน้อยกว่า 50 ก็ random ต่อไปเรื่อยๆ
ขอคำแนะนำด้วยคับ........ T^T
|