Results 1 to 4 of 4

Thread: Opening a form within a MIDI form an infanate amount of times

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    10

    Post

    Hello,
    I am stumped right here at this point since this is my first time using a MIDI form setup.

    My question is: How would I open the same form within a MIDI form an infanate amount of times, and on each new opening the form caption would change accordingly (ie.) Untitled 1, Untitled 2, Untitled 3.

    Thank you for who answers


    ------------------
    - M e n S h e n
    Canabatech Programmer

    Homepage http://influx.virtualave.net
    Email [email protected]
    ICQ 17527422



  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    Paste this into the declarations section of the MDI form

    Code:
    Private Sub LoadNewDoc()
        Static lDocumentCount As Long
        Dim frmD As frmFormName
        lDocumentCount = lDocumentCount + 1
        Set frmD = New FormName
        frmD.Caption = "Untitled " & lDocumentCount
        frmD.Show
    End Sub
    Then on the form_load event of the MDI form and wherever you want the user to be able to open a new document, place this

    Code:
    LoadNewDoc
    regards,

    ------------------
    - Chris
    [email protected]
    If it ain't broke - don't fix it

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    10

    Post

    Just as a matter of clarification, you sure do it the hard way.

    Code:

    -----
    [i]
    Dim frm As New Form1
    Static x
    x = x + 1
    frm.Caption = "Untitled " & x
    frm.Show[\i]

    ------------------
    - M e n S h e n
    Canabatech Programmer

    Homepage http://influx.virtualave.net
    Email [email protected]
    ICQ 17527422



  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    10

    Post

    lol, guess I screwed up with the UBB code, ohh well.

    ------------------
    - M e n S h e n
    Canabatech Programmer

    Homepage http://influx.virtualave.net
    Email [email protected]
    ICQ 17527422



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