This problem occurs when you add some active control like web browser.I added web browser in some panel and tried to run the application, it says
"System.Threading.ThreadStateException was unhandled"
Solution:-
So just add [STAThread] above the main function where you instantiate the class.
e.g.(c#)
[STAThread]
static void Main()
{
Application.Run(new Parent_Form());
}
Useful Links:-
Thursday, March 5, 2009
Setting child window location in MDI .NET
This problem occurs when you load a new child form inside the parent window while using MDI, but you are not able to set its location according to your requirement.
So there is some trick which i used.
say name of the child form is "form1"
form1.StartPosition = FormStartPosition.Manual;
form1.Location = new Point(50, 620);/* any arbitrary location*/
form1.Show();
Useful links
Thanks,
Gaurav Nanda
So there is some trick which i used.
say name of the child form is "form1"
form1.StartPosition = FormStartPosition.Manual;
form1.Location = new Point(50, 620);/* any arbitrary location*/
form1.Show();
Useful links
- http://www.daniweb.com/forums/thread43508.html
- http://bytes.com/groups/net-vb/354590-centerparent-not-working
- http://www.dotnet247.com/247reference/msgs/46/230816.aspx
Thanks,
Gaurav Nanda
Subscribe to:
Posts (Atom)