W/o using an array, is there a way to load objects onto a form at runtime? I mean completely new objects. I am trying to load all my objects through dlls so I can patch a program bug easily in the future. thanks in advance
Printable View
W/o using an array, is there a way to load objects onto a form at runtime? I mean completely new objects. I am trying to load all my objects through dlls so I can patch a program bug easily in the future. thanks in advance
yeah, there should be several ways, createobject, controls.add and more... YOu just need vb6 to make it work.
Go search for it, there's hundreds of threads about this
more specificly, with vb5
Use CreateWindowEx for VB5.
Code:Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const WS_CHILD = &H40000000
Private WithEvents btn As CommandButton
Private Sub Form_Load()
retval = CreateWindowEx(0&, "Button", "Button1", WS_CHILD, 32, 32, 64, 64, Me.hwnd, 0, App.hInstance, ByVal 0&)
ShowWindow retval, 1
End Sub