G
Guest
I have a form (formA). This form used to following code on FormA to load a
new form(FormB).
formB f = new formB();
f.ShowDialog();
However: on formB, I am unable to access any object (ListBox) created on
FormA. I have the listbox set to internal, however: I cannot seem to be
able to access the selected value of the listbox. I am using the following
code:
int iVerseID;
VerseGroupUtility.frmMain fMain;
fMain = (frmMain)this.Parent;
iVerseID = (int)fMain.lbGroups.SelectedValue;
I keep getting a System.NullReferenceException error, however: I am 100%
positive that there is a value selected and it has a value.
Would anyone be able to provide some information for what I am missing or
doing wrong?
Thanks
Andy
new form(FormB).
formB f = new formB();
f.ShowDialog();
However: on formB, I am unable to access any object (ListBox) created on
FormA. I have the listbox set to internal, however: I cannot seem to be
able to access the selected value of the listbox. I am using the following
code:
int iVerseID;
VerseGroupUtility.frmMain fMain;
fMain = (frmMain)this.Parent;
iVerseID = (int)fMain.lbGroups.SelectedValue;
I keep getting a System.NullReferenceException error, however: I am 100%
positive that there is a value selected and it has a value.
Would anyone be able to provide some information for what I am missing or
doing wrong?
Thanks
Andy