Results 1 to 3 of 3

Thread: error 429 argh! error 438! argh again

  1. #1

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Public obj As Object
    Private Sub Form_Click()
    Set obj = CreateObject("VB.PictureBox")
    End Sub

    can someone tell me why this doesn't work on my comp? I have VB5 Ent edit, but it should work!




    Option Explicit
    Private WithEvents btnObj As CommandButton
    Private Sub btnObj_Click()
    MsgBox "This is a dynamically added button."
    End Sub
    Private Sub Form_Load()
    Set btnObj = Controls.Add("VB.CommandButton", "btnObj")
    With btnObj
    .Visible = True
    .Width = 3000
    .Caption = "This button was created on the fly!"
    .Top = 1000
    .Left = 1000
    End With
    End Sub

    This example didn't work either 438 - Object doesn't support this method on the Controls.Add method
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    You need vb6 to create controls at runtime. With vb5 you can only add controls to an existing control array.

  3. #3

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I knew it! I knew it! I knew it! I knew it! I knew it! I knew it! I knew it! I knew it! I knew it!
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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