ถ้าใส่ตัวดำเนินการ ที่เป็นเครื่องหมาย = และตามด้วยจำนวนตัวเลข% ล่ะ! ..จะเกิดอะไร?
-----------------------------------------------------------------------
---------------------------------------------------------
ผลที่ได้..progressbar วิ่งมาถึง 50% ก็จะหยุดวิ่งชั่วคราว แล้วมี Message ขึ้นมาบอกเงื่อนไข%
ถ้าเราคลิ๊ก ok ยืนยันเงื่อนไข ..progressbar ก็จะวิ่งต่อไปจนครบ 100%
-----------------------------------------------------------------------
Code:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click ProgressBar1.Minimum = 0 ProgressBar1.Maximum = 100 ProgressBar1.Step = 1 ProgressBar1.Value = 0 Dim x As Integer For x = 1 To 100 x += 1 ProgressBar1.Value += 1 ProgressBar1.PerformStep() Threading.Thread.Sleep(50) If x = 50 Then MsgBox("BarCurrent = 50%", MsgBoxStyle.Information, "") '<-Message ยืนยันการทำงาน ตามเงื่อนไข-< End If Next x If ProgressBar1.Value >= 100 Then Threading.Thread.Sleep(500) MsgBox("Completed.", MsgBoxStyle.Information, "") ProgressBar1.Value = 0 End If End Sub End Class
ผลที่ได้..progressbar วิ่งมาถึง 50% ก็จะหยุดวิ่งชั่วคราว แล้วมี Message ขึ้นมาบอกเงื่อนไข%
ถ้าเราคลิ๊ก ok ยืนยันเงื่อนไข ..progressbar ก็จะวิ่งต่อไปจนครบ 100%

Comment