M
Mark F.
I have a dialog the displays info. When called from the main form I need to
access the property values in my CurrentProject class. The values are null
when I attempt to access them from the dialog class. I'm not sure how to
make the properties accessible to all other classes in the project.
// CurrentProject.cs
// This class holds properties for the user's project they are working on
(not the C# project).
public string ProjectPath
{
get { return _projectPath; }
set { _projectPath = value; }
}
// mainform.cs
CurrentInfoDialog dlg = new CurrentInfoDialog();
dlg.ShowDialog();
// CurrentInfoDialog.cs
public partial class CurrentInfoDialog : Form
{
CurrentProject cp = new CurrentProject();
// in this class all properties returned from 'cp' are null!
Public CurrentInfoDialog()
{
etc....
Thanks,
Mark
access the property values in my CurrentProject class. The values are null
when I attempt to access them from the dialog class. I'm not sure how to
make the properties accessible to all other classes in the project.
// CurrentProject.cs
// This class holds properties for the user's project they are working on
(not the C# project).
public string ProjectPath
{
get { return _projectPath; }
set { _projectPath = value; }
}
// mainform.cs
CurrentInfoDialog dlg = new CurrentInfoDialog();
dlg.ShowDialog();
// CurrentInfoDialog.cs
public partial class CurrentInfoDialog : Form
{
CurrentProject cp = new CurrentProject();
// in this class all properties returned from 'cp' are null!
Public CurrentInfoDialog()
{
etc....
Thanks,
Mark