Results 1 to 3 of 3

Thread: How to create object without using "NEW"?

Threaded View

  1. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    I assume the objects are things such as Command Buttons and Text Boxes?

    VB Code:
    1. Private Function CreateNewInstance(frm As Form, obj As Object)
    2. If TypeOf obj Is CommandButton Then
    3.     Set obj = frm.Controls.Add("VB.COMMANDBUTTON", "NewCommandButton")
    4.     obj.Visible = True
    5. End If
    6. End Function

    Is this what you are after?

    Phreak
    Last edited by «°°phReAk°°»; Apr 11th, 2004 at 10:12 AM.

    Visual Studio 6, Visual Studio.NET 2005, MASM

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