
自定义的控件。
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Dim WithEvents NewText As Frame
Dim WithEvents NewButton As CommandButton
Dim WithEvents Newsam As UserControl1
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Sub cmdCommand1_Click()
Dim sam1 As String
sam1 = "sam" & a1
Set Newsam = Controls.Add("VB.UserControl1", sam1, Picture1)
End Sub