Simon Mourier's Avatar
Simon Mourier's blog (1807 answers on StackOverflow) about Microsoft technologies C#, C/C++, .NET, WinRT, WinUI3, AOT, P/Invoke, COM, Interop, DirectX, Direct2D, Windows, ...
  • 🔎︎ Search
  • Categories
  • Archives
  • About Me
  • reflection
  • wcf
  • winforms

WinForms: How to get a reference to a Loaded Form

Dec 13, 2012 See the question and my original answer on StackOverflow

You should use the ParameterizedThreadStart constructor and pass the Form instance for example, something like this:

Dim th As New Thread(AddressOf (New Ecoute).Ecouter)
th.Start(this)

Sub Ecouter(ByVal data As Object)
' you can safely cast data as a Form
End Sub
  • SmoBlog © 2010-2026 Simon Mourier. All rights reserved.
  • Privacy & Terms