Link to home
Start Free TrialLog in
Avatar of Tekati68
Tekati68Flag for United States of America

asked on

Not able to open sub form from main form.

I have a main form called Receiving and I am trying to open a new form that I created using Project Add Windows Form with the name of UserAdmin.

This is the function from the main form.

        private void LoadUserAdmin_Click(object sender, EventArgs e)
        {
            UserAdmin ua = new UserAdmin();
        }

The issue is that UserAdmin which is the correct name of the second form is not recognized in the main form and I am getting errors of.

The type of namespace name 'UserAdmin' could not be found (are you missing a using directive or an assembly reference?)
private void LoadUserAdmin_Click(object sender, EventArgs e)
{
     UserAdmin ua = new UserAdmin();
}

Open in new window

Avatar of Priest04
Priest04
Flag of Serbia image

Make sure that both LoadUserAdmin and UserAdmin are in the same namespace.

Goran
surely you have a namespace problem. Review your main form and useradmin implementation files and check which namespace each belong to.
ASKER CERTIFIED SOLUTION
Avatar of Priest04
Priest04
Flag of Serbia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hmm, just noticed we are writing at the same time (well, me some seconds late).
not a problem, it was just funny, that we wrote in the same time same things both times. :)
>>it was just funny, that we wrote in the same time same things both times.
That sound sounds like a double-check answer!
Avatar of Tekati68

ASKER

That was the issue and much appreciated.  One final question though all of the examples I have seen have not refered to the NameSpace like that so can you please tell me what I did wrong in the first place.  Where did I go wrong to start with?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial