The thread peet gave pretty much covers it but since I already typed this out here you go.VB Code:
Option Explicit Dim WithEvents cmd As CommandButton Dim pic As PictureBox Private Sub cmd_Click() Set pic = Controls.Add("VB.PictureBox", "pic") With pic .Top = cmd.Height .Left = 0 .AutoRedraw = True .AutoSize = True .Picture = LoadPicture("C:\My Documents\logo.bmp") .Visible = True End With End Sub Private Sub Form_Load() Set cmd = Controls.Add("VB.CommandButton", "cmd") With cmd .Left = 0 .Top = 0 .Caption = "Add Picture" .Visible = True End With End Sub




Reply With Quote