Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var thread = new Thread(() => ThreadOpenFile(args));
- thread.TrySetApartmentState(ApartmentState.STA);
- thread.Start();
- private static void ThreadOpenFile(string[] args)
- {
- ApplicationContext appCnxt= new ApplicationContext(new newForm(args[1]));
- Application.Run(appCnxt);
- }
- private static void ThreadOpenFile(string[] args)
- {
- Application.Run(new newForm(args[1]));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement