Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

inherited form problem with access to ancestor object

$
0
0

I have a form A:Formb

form A has a custom control  myUC which has internal properties and members Ican access from form A
 public virtual void setDisplay(){ }
 internal Dictionary<string,int> optionList = new Dictionary<string,int>();
 internal ListBox optionLbx=new ListBox();

then in windows application mainform

I declared

public class mydlg:A()
{
	public override setDisplay()
	{
		optionList.Add("some options name",0);// optionList not exists or defined
		optionList.Addnotheroptions name",1);
		optionList.Add("some options name",0);
		optionLbx.DataSource = optionList;// got flagged as not exists or defined
	}
}

what did i do wrong?


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>