RE:¿Cómo Creo un Objeto desde código?
Para esas respuestas...
Puedes hacerlo de 2 maneras..
Como ya te dijeron (aunque el ejemplo no es nada que ver con lo que pides) :
Pon un Label llamado Label1 con Index 0 y en un boton pones :
Private Sub Command1_Click()
Load Label1(1)
Label1(1).Top = 100
Label1(1).Left = 50
Label1(1).Visible = True
End Sub
La otra manera es para hacer un Label desde NADA, osea sin ocupar que ya tengas algun Label
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 SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetStockObject Lib "gdi32.dll" (ByVal nIndex As Long) As Long
Const WS_CHILD As Long = &H40000000
Const WS_VISIBLE As Long = &H10000000
Const WM_SETFONT As Long = &H30
Const DEFAULT_GUI_FONT As Long = 17
Private Sub Command1_Click()
' Crear
hTemp = CreateWindowEx(0, "STATIC", "Label creado con Apis", WS_CHILD Or WS_VISIBLE, 10, 10, 120, 20, Me.hwnd, vbNull, App.hInstance, ByVal 0&)
' Leer la fuente por default
hFont = GetStockObject(DEFAULT_GUI_FONT)
' Cambiar la fuente del label creado
SendMessage hTemp, WM_SETFONT, hFont, 1
End Sub