[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Error with threads and opening forms

Thorgal

5/10/2007 9:55:00 AM

Hello, I have following problem.

I created a thread in frmMain_Load

tr1 = New System.Threading.Thread(AddressOf AlarmenBekijken)
tr1.Start()

In AlarmenBekijken I check some changes in a database with a timer, if
my data changes i would like to open a new form .

So i though something like this.

Public sub Timer1_Tick

if bNewAlarm = true then
dim T as string
T = "Alarm Activation"
FormOpenAlarm(T)

end sub

Public Delegate Sub PopUpOpenen(ByVal te As String)

public sub FormOpenAlarm (T as string)
Dim pop As New PopUpOpenen(AddressOf AlarmOpenen)
pop.Invoke(oAlarm)
end sub

Private Sub AlarmOpenen(ByVal oAlarm As clsAlarmen)
Dim of As New frmAlarmPopUp(oAlarm)
of.BringToFront()
of.Show()
end sub



When I try to open it, the new form opens but stays white, So i gues
something is wrong with my delegates but i don't know what?

Can anybody help me please

If i try it with a messagebox instead everythings works but not with a
new form?