私はこれを作ろうとしています:
class A {
//attibutes
}
class B : A {
public int classBAttribute = 5;
// other attributes and methods
}
私の質問は、A クラスのインスタンスがある場合、B クラスのインスタンスを取得したり、その属性にアクセスしたりするにはどうすればよいですか?
B b = new B();
Application.Add(b);
//other form
A a = Application.GetA();
B b = getBFromA(a);// ??? Note: B b = a as B; does't work i tried