|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Late binding; call could fail at run time.Public pPrintMonthColl As Collection = New Collection pPrintMonthColl.Add(checkBox1) pPrintMonthColl.Add(checkBox2) pPrintMonthColl.Add(checkBox2) Now when I try to access a control in the collection as follows: pPrintMonthColl(2).Checked = True I receive the following error message: Late binding; call could fail at run time. How can I correct this? tm tm wrote:
Show quoteHide quote > I have created a collection as follows: directcast(pPrintMonthColl(2), checkbox).Checked = True> > Public pPrintMonthColl As Collection = New Collection > > pPrintMonthColl.Add(checkBox1) > pPrintMonthColl.Add(checkBox2) > pPrintMonthColl.Add(checkBox2) > > Now when I try to access a control in the collection as follows: > > pPrintMonthColl(2).Checked = True > > I receive the following error message: > > Late binding; call could fail at run time. > > How can I correct this? > > tm > > > Chris tm,
By not using late binding. Late binding can be used if you are converting a program from VB6 to VB.Net, in all other situations set in top of your program "Option Strict On" or set that in the standard options. (I have done that and set if I want a program with late binding in top of my program "Option Strict Off". Which I don't have :-) I hope this helps, Cor
VB.NET or C#.NET ???
Is there a difference between passing "" and passing Nothing to a Windows API ? Moving a project from 2003 to 2005 Time? UI Design question reading text files TCP/IP Socket communication from multiple clients Help to Italy Open a text file and into an array ?? Need help with LastIndexOf |
|||||||||||||||||||||||