This is the code to align the content of a Panel in the Center, Hope this Helps :)
Align Contents of a Panel in the Center
'You Will need 1 Panel Control and 1 PictureBox Control inside the Panel Control
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Panel1.AutoScroll = True
'Tell the Panel Control
'to show ScrollBars when the
'controls Are out of the Panel's Visible Boundaries
End Sub
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
Panel1.Width = Me.Width - 50
Panel1.Height = Me.Height - 70
'This is the Main PART!!!
PictureBox1.Top = Panel1.Height / 2 - PictureBox1.Height / 2
PictureBox1.Left = Panel1.Width / 2 - PictureBox1.Width / 2
End Sub
End Class
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.