Creating and Showing a Form from a Callback Function

  • Thread starter Thread starter db_from_mn
  • Start date Start date
D

db_from_mn

I have a callback function that executes when my USB
device is plugged in. I want to create and show a Windows
form when this happens. For some reason, I am not able to
do this. When I try, the form is all white, and I see an
hour-glass cursor.
If I create and show the form from a push-button click
event, it works with no problem.
Any idea why I can't do this?
Thanks,
Dennis
 
Look into marshalling and invoking. Someone could probably give you code on
this, but the idea is that your callback is running in a different thread
than your UI and you need to invoke the UI thread to display the form from
there.
 
Hello Adam,
Thanks,
One interesting thing is that the ShowDialog method seems
to work ok, but not the Show method.
Dennis
 
Back
Top