المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Problem with MdiParent-MdiChildren forms



C# Programming
06-01-2009, 10:52 AM
Hi all
I’m having 2 problems in C# now.

1. I have a MDIParent form which loads the login form in the form_load event. From there I if the user login successfully, I want to enable all menu items on the menu bar. If the login is fail, I want to disable some menu items there too. This means I want to enable/disable a MdiParent’s element from a child form, please help me how to do that.
2. From question 1, when I want to open a form from the menu, I create an object then just show it like this.

frmCustomer frmCus=new frmCustomer();
frmCus.MdiParent=this;
frmCus.Show();

But the problem is while a Customer form is opening, when the Customer menu is clicked, it creates another Customer form for me. Is there any way to check weather the form is shown or not before showing it?