Evo klase:
Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace BufferBoxApp
{
class Wait
{
Thread wt;
frmWait w;
public delegate void UgasiWait();
public Wait()
{
wt = new Thread(new ThreadStart(StartajWait));
wt.Priority = ThreadPriority.AboveNormal;
wt.Start();
}
void StartajWait()
{
w = new frmWait();
w.ShowDialog();
}
public void Ugasi()
{
w.Visible = false;
w.Close();
if (wt != null)
wt.Interrupt();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace BufferBoxApp
{
class Wait
{
Thread wt;
frmWait w;
public delegate void UgasiWait();
public Wait()
{
wt = new Thread(new ThreadStart(StartajWait));
wt.Priority = ThreadPriority.AboveNormal;
wt.Start();
}
void StartajWait()
{
w = new frmWait();
w.ShowDialog();
}
public void Ugasi()
{
w.Visible = false;
w.Close();
if (wt != null)
wt.Interrupt();
}
}
}
Forma iz koje pozivam thread:
Code:
void Filtriraj()
{
wait = new Wait();
... nesto se odradjuje oko 10 sec ...
BeginInvoke(new Wait.UgasiWait(wait.Ugasi));
wait = null;
}
void Filtriraj()
{
wait = new Wait();
... nesto se odradjuje oko 10 sec ...
BeginInvoke(new Wait.UgasiWait(wait.Ugasi));
wait = null;
}
Nemam iskustva sa thread-ovima pa ako neko moze da pomogne.
SELECT * FROM หน่วยงานหลัก WHERE ยสันติ LIKE 'โดย%'