Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. var thread = new Thread(() => ThreadOpenFile(args));
  2. thread.TrySetApartmentState(ApartmentState.STA);
  3. thread.Start();
  4.  
  5. private static void ThreadOpenFile(string[] args)
  6. {
  7. ApplicationContext appCnxt= new ApplicationContext(new newForm(args[1]));
  8. Application.Run(appCnxt);
  9. }
  10.  
  11. private static void ThreadOpenFile(string[] args)
  12. {
  13. Application.Run(new newForm(args[1]));
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement