I have vb.net form that opens another vb.net exe to test. I am trying to test if a specific textbox has focus when the exe is loaded.
My tester form loads the exe using Assembly.UnsafeLoadFrom(_path) It then runs the FormtoTest on a new thread
I use the System.Type.GetProperty() and GetFields() functions to get all of the FormtoTest's input fields and their properties.
I then find this textbox in the list of input fields,
But when I call the System.Type.GetProperty("Focused"), I get an error: "Cross-thread operation not valid: Control 'txtID' accessed from a thread other than the thread it was created on."
Thanks for your help!