To programmatically get the control, you can create a
handle to the PictureBox class. Before using the control, make sure you
add it to the list of Controls of the form that will host it. Here is an
example:
Imports System.Drawing
Imports System.Windows.Forms
Module Exercise
Public Class Starter
Inherits Form
Private pctBox As PictureBox
Dim components As System.ComponentModel.Container
Public Sub New()
InitializeComponent()
End Sub
Public Sub InitializeComponent()
pctBox = New PictureBox()
Controls.Add(pctBox)
End Sub
End Class
Function Main() As Integer
Dim frmStart As Starter = New Starter
Application.Run(frmStart)
Return 0
End Function
End Module
|