Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

raise event asyncronously on the same thread

$
0
0

I am using vb.net 3.5 forms

I need to raise an event ascynronously from the UI thread to the UI thread.  I need it to behave like a button click, timer tick or backgroundworker completed event

I neet the following code to show "one two three", but I get "one three two".  the event acts like a function call.

public sub test()
console.write("one ")
raiseevent testevent(me,new eventargs)
console.write("two ")
end sub
private sub test2(sender as object, e as eventargs) _
handles me.testevent
console.write("three ")
end sub
please keep in mind that this is NOT a WPF application

Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>