Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2007

Tip: Looking for answers? Try searching our database.

Unknown Form Load Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg - 01 Oct 2007 01:50 GMT
When loading my project i get the following error message.

The form referred to itself during construction from a default instance,
which led to infinite recursion. Within the Form's constructor refer to the
from using "Me.".

I have a main form named frmMain. I have another form named frmProjects.
Within the form frmProjects I have a combo box event called
_EditValueChanged, which makes a call back to a Public Procedure in frmMain
called frmMain.sDisplayProjects, which display values on the frmProjects form
from the frmMain form. I am also doing a similar thing in a form named
frmGroups.

What I noticed is if I comment out the code in my _EditValueChanged event on
the frmProjects from, the error goes away. Is it illigal to have a event in
one form call a Public Procedure in another form that in turn populates
controls in the calling form?

I hope what I have said makes some sense.
Charlie - 01 Oct 2007 04:16 GMT
It sounds like you have code in the constructor that probably should not be
there.

In the ComboBox_SelectedIndexChanged event procedure you can
Create a reference to frmMain using the modForms hashtable that I described
in my other response.

dim Fmain as form = modForms.Forms("frmMain")

You would have a friend or public function in FMain that takes one or more
parameters which indicate to the function what you need, and the function
will be written to return the data needed by your project form...as an
ArrayList, or whatever object serves your purposes.

Friend Function GetProjectData(ComboItem as String) as ArrayList
  dim ProjList as new ArrayList
  'Add code to get the data you need
  Return ProjList
End Function

Then you can call the function from your project form, get the return value,
and  handle the data from within the project form.

Don't try to manage your project form from within the main form...just get
the data you need using the function, and manage the data from within the
project form.

> When loading my project i get the following error message.
>
[quoted text clipped - 15 lines]
>
> I hope what I have said makes some sense.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.