Recent Posts
PHP | 19 sec ago
PHP | 24 sec ago
Perl | 28 sec ago
Java | 31 sec ago
None | 32 sec ago
None | 32 sec ago
PHP | 35 sec ago
None | 35 sec ago
None | 51 sec ago
Bash | 57 sec ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By ninlar on the 26th of Jan 2009 03:29:39 AM Download | Raw | Embed | Report
  1. Imports System.Threading
  2.  
  3. Public Class Form1
  4.  
  5.     Private Delegate Sub NoParams()
  6.  
  7.  
  8.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  9.         Dim tThread As New Thread(New ParameterizedThreadStart(AddressOf ListenThread))
  10.  
  11.         tThread.Start(Me)
  12.  
  13.     End Sub
  14.  
  15.     Private Sub ListenThread(ByVal frmMain As Object)
  16.         Dim dlgMain As Form = Nothing
  17.  
  18.         dlgMain = CType(frmMain, Form)
  19.  
  20.         Thread.Sleep(2000)
  21.         dlgMain.Invoke(New NoParams(AddressOf ShowMsgBox))
  22.  
  23.  
  24.  
  25.     End Sub
  26.  
  27.     Private Sub ShowMsgBox()
  28.         MessageBox.Show("This is a messagebox that was created from a thread")
  29.     End Sub
  30. End Class
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: