-
Hi!
I have a big proplem. I have a TV guide program which take's it's data from my frends server. Ok that works fine, but the proplem is that i would like to present the info on mdichild forms. Thats still ok, but the proplem is that I would like to have a index for these forms so I could have one form as a base form and make more forms like that to present different channels on the fly. Is there a way to do that? I know how that you can use the load command for images so there must be a way to do this too.
Thanks in advance,
Worf
-
<?>
you could try something like giving a generic name to the form such as TvForm and then as you add forms you would name them TvForm1, TvForm2, etc
then you could call them in a loop
for i = 1 to forms count
load TvForm & i
show TvForm & i
next
or out of a loop
load TvForm & yourVariableNumber
Maybe?
-
No, sorry.
The big proplem is that I have to make all the forms by hand and so they take a lot of space in the exe file when insted of this I could just tell vb to make a dublicat of the orginal. To do what you just told me you have to do this:
Private Sub Command1_Click()
openfrm 1
End Sub
Private Sub openfrm(frm As Integer)
Select Case frm
Case 1
frmtv1.Show
Case 2
frmtv2.Show
.
.
.
End Select
End Sub
So does any one know how to open a new form with code.
-
Example is more accurate then I can explain it.
Try This:
Code:
Private Sub Command1_Click()
Dim frmNewTVGuid As Form
Set frmNewTVGuid = New Form2 'Add new Form
frmNewTVGuid.Caption = Forms.Count 'Show Form Count for test
frmNewTVGuid.Show 'Show the new form
End Sub
Hope it helps
-
Thanks alot I got it working.
I just but the baseform in the place of form2.
Thanks you very much I got my project up and
running again!
Worf