System.ComponentModel.Win32Exception...error creating window handl

G

Guest

Dear C# experts,
i face a problem which let my project get stopped ..when trying to run
...i found the following exception

"An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.windows.forms.dll
Additional information: Error creating window handle."


at this lines of my code

private void frmMdiMain_Load(object sender, System.EventArgs e)
{ string st ;
frm.MdiParent = this;
try

{
frm.Show();
}

catch (Exception ex)
{
st =(ex.Message);
Console.Write(st);
}
}


/// st = error creating window handle.


could you tell me kindly what shall i do?!

Thank you in Advance
urs
Mohannad
 
G

Guest

the sequence of my code is like this :
private void InitializeComponent()
{ ...
this.IsMdiContainer = true; // it is
already exists
....}

Form1 frm = new Form1(); //here frm is created
frmAlarmBox AlarmBox = new frmAlarmBox();
TcpIpConnection TCPListen;
bool blnAlarmState = false;

private void frmMdiMain_Load(object sender, System.EventArgs e)
{
frm.MdiParent = this;
frm.Show();
}

static void Main()
{
Application.Run(new frmMdiMain ());
}

/********************************************************/
 
G

Guest

the sequence of my code is like this :
private void InitializeComponent()
{ ...
this.IsMdiContainer = true; // it is
already exists
....}

Form1 frm = new Form1(); //here frm is created
frmAlarmBox AlarmBox = new frmAlarmBox();
TcpIpConnection TCPListen;
bool blnAlarmState = false;

private void frmMdiMain_Load(object sender, System.EventArgs e)
{
frm.MdiParent = this;
frm.Show();
}

static void Main()
{
Application.Run(new frmMdiMain ());
}

/********************************************************/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top