blairacuda
Technical User
OK, this is driving me crazy. I know it has to be something simple.
I have two classes in the same namespace. I can't access the methods in one class from the other class. But I can create the object...
Here is an example:
--First.cs--
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Simple
{
class First
{
Second s = new Second();
}
}
--Second.cs--
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Simple
{
public class Second
{
string name = "Chris";
public Second();
public void displayName()
{
MessageBox.Show(name);
}
}
}
I can create the object but not call displayName(). It isn't available... Where in the world am I messing up?
Thanks in advance,
Chris
Chris Blair
Crystal, InstallShield, branching out in other programming realms.
I have two classes in the same namespace. I can't access the methods in one class from the other class. But I can create the object...
Here is an example:
--First.cs--
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Simple
{
class First
{
Second s = new Second();
}
}
--Second.cs--
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Simple
{
public class Second
{
string name = "Chris";
public Second();
public void displayName()
{
MessageBox.Show(name);
}
}
}
I can create the object but not call displayName(). It isn't available... Where in the world am I messing up?
Thanks in advance,
Chris
Chris Blair
Crystal, InstallShield, branching out in other programming realms.