Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Usinf Multiple forms in C#

Status
Not open for further replies.

mtek13

Programmer
Aug 23, 2001
24
0
0
CA
HI,

I am working on a project that has main form that uses the Shellib to Dock to the top of the screen wich is working fine but when i added a new form and now i am trying to open it from a button on the main form it opens it but i am not able to use any control on that new form, it looks like the new form looses the focus and even if i click on it to set the focus it will lose it again.

I am using the statement .Show() and also used .ShowDialog()
did not help much

If someone has an idea how to resolve this problem please reply to me with a website where i can find some help or actually the trick to go around this.

Regards
Mo
 
It sounds like you have an event firing int he parent form that is causing it to regain focus. If you have any code in the child form that would cause focus to return to the parent form you might want to comment it out to see where the problem is.
 
Well i tried that, no code at all appears on the child form now, and the parent form has timer i disabled it and still same issue.
 
There is still the ChildActivated event in the parent form, that could be causing the problem.

what code do you use to open the new form?
 
Form frm = new frmPad();
frm.Show()
 
i think it should be:

frmPad frm = new frmPad();
frm.Show();

at least thats how I usually do it, and I havent had any problems.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top