Public Class Form1
Private pictureBox1 As New PictureBox()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Dock the PictureBox to the form and set its background to white.
pictureBox1.Dock = DockStyle.Fill
pictureBox1.BackColor = Color.Transparent
pictureBox1.BackgroundImage = My.Resources.Textleiste
'Hier soll die größe des BackgroundImages der PictureBox ermittelt werden.
' Connect the Paint event of the PictureBox to the event handling method.
AddHandler pictureBox1.Paint, AddressOf Me.PictureBox1_Paint
' Add the PictureBox control to the Form.
Me.Controls.Add(pictureBox1)
End Sub
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs)
Dim g As Graphics = e.Graphics
g.DrawString("deintext", New Font("Tahoma", 12, FontStyle.Bold), Brushes.White, New PointF(1.0F, 0.5F))
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Application.Exit()
End Sub
End Class