Hi all,
First of all I'd like to apologise. There are many many posts about this around the net, however I just can't for the life of me get mine to work.
Simply, I was to be able to expose myTextBox or myListBox to a child class.
Any pointers to anything obvious I'm doing wrong? I've tried using 'base' or 'form' and even tried passing the base form as a reference to the constructor.
Thanks for any help.
James
First of all I'd like to apologise. There are many many posts about this around the net, however I just can't for the life of me get mine to work.
Simply, I was to be able to expose myTextBox or myListBox to a child class.
Code:
namespace MyApp
{
public partial class MyNewApp : Form
{
public void doSomething(string s)
{
myFormListbox.items.add(s);
}
// Custom Class
public static myClass myClassObject = new myClass();
public class myClass
{
private string myVar;
//Constructor
public myClass()
{
}
//Destuctor
~myClass()
{
}
//Some things
public string getKey()
{
return this.myVar;
}
public void setName(string sValue)
{
this.myVar = sValue;
}
public void addToListBox(string s)
{
doSomething("test");
}
}
}
}
Thanks for any help.
James
Comment