Results 1 to 2 of 2

Thread: 'duplicating' forms

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506

    'duplicating' forms

    k, im duplicating a form in runtime but im having trouble trying to reference to it???
    VB Code:
    1. Dim f As Form1
    2. Set f = New Form1
    using that method, how could i easily reference to each of my duplicate forms? say for instance, add text to a textbox control on one of the forms?

  2. #2
    Hyperactive Member Alan777's Avatar
    Join Date
    Jan 2001
    Location
    New Zealand
    Posts
    303
    Set the project to start in Sub Main;

    Code:
    Public f As Form1
    
    Sub Main()
    
     Set f = New Form1
     f.Text1.Text = "Hello"
     f.Show
    
    End Sub
    You could also use an array eg:
    Public f(5) as Form1
    "Today's mighty oak is just yesterday's nut,
    that held its ground."

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