Results 1 to 5 of 5

Thread: Form index?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    11
    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
    "64K should be enough"

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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?

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    11

    Unhappy

    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.
    "64K should be enough"

  4. #4
    Guest
    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

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    11

    Smile

    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
    "64K should be enough"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width