Hi ,
Im learning c#. I have to develop a program for secretary so they can edit and save changes about the users in Active Directory. At the moment only one secretary and 100 users.
I want the loading of a MDI-Form after the user enter his password. In Visual Basic I did for many years ago something like that:
If LoginSucceeded = True Then
mdiMain.Show
In c# I wrote this but it doesnt work. : - ( At the moment I only want to know how I can load the MDI-Form from Login-Form. Cheers
private void btnOk_Click(object sender, EventArgs e)
{
try
{
if (true){
frmMDImain.ActiveForm.Show();}
else{
}
catch (Exception ex) { MessageBox.Show(ex.Message);}
}
}
AlanPosted Aug 1, 2008, 4:48 AM
If the login form is your start up form (i.e. the form that first appears when the application starts), then you'll need to create an instance of the MDI form before you can show it.
Depending on the class name of the form, something like:
MDImain frmMDImain = new MDImain();
frmMDImain.Show();
latinaPosted Aug 1, 2008, 5:15 AM
wonderfull it works, I was thinking in a complicated way because of MDI-Form but its not necesary. Many thanks, muchas gracias. So I see without instanz the communication is not posible between forms, event and so on.
latina