Results 1 to 5 of 5

Thread: Multiple instances of a form

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    I read this http://209.207.250.147/showthread.php?threadid=27514
    but I didn't get it . I have a from called frm_Pm . What I want is to be able to make mutiple instances of it . It's to send personal messages in a winsock app . How is this done ?
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

  2. #2
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    Hi PRIVATE1,
    Code:
    Dim frmcnt As Integer
    Dim NewFrm() As frm_Pm
    Sub CreateNewInstance()
       frmcnt = frmcnt + 1
       Redim Preserve NewFrm(frmcnt)
       Set NewFrm(frmcnt) = New frm_Pm
       With NewFrm(frmcnt)
          .Visible = True 'Shows the new form
          'You can do anything to the new instance of the form here.
       End With
    End sub

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    Thank you
    BTW if I create these froms when I'm done using them Should I Unload them With the Unload Statement ?


    [Edited by PRIVATE1 on 09-14-2000 at 08:05 AM]
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

  4. #4
    Addicted Member
    Join Date
    Sep 2000
    Posts
    219
    Yeah, that will free up memory.

  5. #5
    Guest
    The resources are automatically freed when WM_DESTROY is called, however, you can be extra safe and use Set Form = Nothing to free up resources.
    Code:
    Unload MyForm
    Set MyForm = Nothing

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