Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick
'listbox1 ใส่ listbox2
For Each item As ListItem In ListQw.Items
If ListQw.Items.Contains(item) Then
Dim newitem As New ListItem(item.Text, item.Value)
ListCall.Items.Add(newitem)
End If
Next
ListQw.Items.Clear()
'listbox2 ใส่ listbox3
For Each item As ListItem In ListCall.Items
If ListCall.Items.Contains(item) Then
Dim newitem As New ListItem(item.Text, item.Value)
ListQDown.Items.Add(newitem)
End If
Next
ListCall.Items.Clear()
End Sub
Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick
'listbox1 ใส่ listbox2
For Each item As ListItem In ListQw.Items
If ListQw.Items.Contains(item) Then
Dim newitem As New ListItem(item.Text, item.Value)
ListCall.Items.Add(newitem)
End If
Next
ListQw.Items.Clear()
'listbox2 ใส่ listbox3
For Each item As ListItem In ListCall.Items
If ListCall.Items.Contains(item) Then
Dim newitem As New ListItem(item.Text, item.Value)
ListQDown.Items.Add(newitem)
End If
Next
ListCall.Items.Clear()
Timer1.Enable = False ' ลองเพิ่มดูครับ
End Sub
Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick
'listbox1 ใส่ listbox2
For Each item As ListItem In ListQw.Items
If ListQw.Items.Contains(item) Then
Dim newitem As New ListItem(item.Text, item.Value)
ListCall.Items.Add(newitem)
End If
Next
ListQw.Items.Clear()
'listbox2 ใส่ listbox3
For Each item As ListItem In ListCall.Items
If ListCall.Items.Contains(item) Then
Dim newitem As New ListItem(item.Text, item.Value)
ListQDown.Items.Add(newitem)
End If
Next
ListCall.Items.Clear()
Private Sub Timer1_Tick(sender As Object, e As EventArgs)
'listbox1 ใส่ listbox2
If isFirst = False Then
'listbox1 ใส่ listbox2
For Each item As ListItem In ListQw.Items
If ListQw.Items.Contains(item) Then
Dim newitem As New ListItem(item.Text, item.Value)
ListCall.Items.Add(newitem)
End If
Next
ListQw.Items.Clear()
isFirst = True
Else
'listbox2 ใส่ listbox3
For Each item As ListItem In ListCall.Items
If ListCall.Items.Contains(item) Then
Dim newitem As New ListItem(item.Text, item.Value)
ListQDown.Items.Add(newitem)
End If
Next
ListCall.Items.Clear()
End If
End Sub
--- ฟังก์ชั่นถ่วงความเจริญ
------ ไม่แน่ว่ามีหรือไม่? ลองค้นหาจาก Google เอาเอง
Code (JavaScript)
$(document).on(..., function (event) {
clearTimeout($.data(..., 'timer'));
setTimeout(BossError, 3000)); //1000 ms x s วินาที
});
function BossError() {
var LabelX = $('#LabelX');
var LabelY = $('#LabelY');
...
...
LabelY.html('Hello World');
}
Public Partial Class TEST
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Timer1.Enabled = True
End Sub
Private isFirst As Boolean = False
Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick
'listbox1 ใส่ listbox2
If isFirst = False Then
'listbox1 ใส่ listbox2
For Each item As ListItem In ListQw.Items
If ListQw.Items.Contains(item) Then
Dim newitem As New ListItem(item.Text, item.Value)
ListCall.Items.Add(newitem)
End If
Next
ListQw.Items.Clear()
isFirst = True
Else
'listbox2 ใส่ listbox3
For Each item As ListItem In ListCall.Items
If ListCall.Items.Contains(item) Then
Dim newitem As New ListItem(item.Text, item.Value)
ListQDown.Items.Add(newitem)
End If
Next
ListCall.Items.Clear()
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
End Sub
End Class
Public Class TEST
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Timer1.Enabled = True
End Sub
Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick
'listbox1 ใส่ listbox2
If ViewState.Item("IsFirst") = Nothing Then
'listbox1 ใส่ listbox2
For Each item As ListItem In ListQw.Items
If ListQw.Items.Contains(item) Then
Dim newitem As New ListItem(item.Text, item.Value)
ListCall.Items.Add(newitem)
End If
Next
ListQw.Items.Clear()
ViewState.Add("IsFirst", True)
Else
'listbox2 ใส่ listbox3
For Each item As ListItem In ListCall.Items
If ListCall.Items.Contains(item) Then
Dim newitem As New ListItem(item.Text, item.Value)
ListQDown.Items.Add(newitem)
End If
Next
ListCall.Items.Clear()
End If
End Sub
End Class