hazeljean Posted December 28, 2003 Posted December 28, 2003 need code to launch sub forms from main form. I know this sounds trivial....but this is the problem. I am creating forms on the fly from text files supplied by the user. Since i do not create the form until i read the text file and generate form, I cannot use "show" because the form is not created yet. I several levels of forms i.e. Form1 will call form2 which in turn may call formx, etc. May have up to 5 levels. Would appreciate any suggestions Thank you. Quote
*Experts* mutant Posted December 28, 2003 *Experts* Posted December 28, 2003 So what is the problem you are having? How to create a new form with the settings provided by the user? Im not sure because you really didn't state what the problem is (or I didn't find that :)). If you have trouble creating a form from user settings, give some example of how those settings look like. Calling multiple levels of forms is not hard, simply add a Show method call to a form and you can show however many forms you want. Quote
hazeljean Posted January 1, 2004 Author Posted January 1, 2004 This is example of what I am trying to do in VB.net everthing in brackets are forms as they may appear on the screen. This is a very basic example..the real problem has very complex forms. the main form [questions] calls 3 others forms. one of these subforms [college_degree} calls another sub-form [major] etc I can up have to five sublevels. I am creating the forms on the fly from text files provided by the user. There fore I cannot use Show form...because the form has not been created yet. for example below. I am in form "questions" This form read a text file called "birthyear" The "birthyear form would then be created before I can display the "birthyear" form on the screen. etc. I need to have one or all forms displayed on the screen when they are called(when the checkbox is checked). The Question marks represent checkboxes I think this is done by Parent...child form...but have not been able to get the correct code. Can anyone help? [questions] ? [birthyear] ? [college_degree] ? [year_of_graduation] [birthyear] ? prior to 1950 ? 1951 t0 1975 ? 1976 to 2003 [college_degree] ? BA ? MA ? PHD ? [major] [major] ? Mathematics ? Engineering ? Physics ? [fill_in_blank] [Year_of_graduation] ? [fill_in_blank] Quote
AndreRyan Posted January 2, 2004 Posted January 2, 2004 It looks like you're make a questionaire, and spreading it across a lot of forms, you may be better off just putting "layers" on 1 form and changing the layer that is visible. To load a form from custom data:Dim NextForm As NextQuestion = New NextQuestion() 'Use StreamReader to get the data NextQuestion.WhateverInfoItneeds = Data NextQuestion.Show() Creating forms "on the fly" has never been a problem for me, you just need to keep references to them like in the mainform that is always open(if you're not just leaving all of them Hidden)Public ActiveForms() As Form You'll need to specify what the problem is(Actual code snippet will help us understand better), or whether you're asking if there will be a problem, or what? Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
hazeljean Posted February 6, 2004 Author Posted February 6, 2004 multile levels of forms here is my situation... I need to dynamically create a form from an "ini" file, containing, checkboxes or radiobuttons (depending on the logic of the application) that will in turn, when a checkbox or radiobutton is clicked, will read the appropriate "ini" and dynamically create the next "child" form of that particular menu branch. example: form1 has 3 checkboxes labeled yes, no and maybe. yes gets clicked by the user the app reads "yes.ini" which contains 2 more checkboxes labeled yes and sure. I need the app to be able to dynamically create this form2 with checkboxes labeled yes and sure. so far I have the main form1 being done this way, but I cannot get the checked boxes to use the subroutine to create the next form(s)..I say forms because this "marching menu" can be many levels deep. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.