Hi @~OSD~ ,
You can handle the Resize
event of the form and adjust the position of the PictureBox accordingly
Private Sub Form1_Resize(sender As Object, e As EventArgs) Handles MyBase.Resize
CenterPictureBox()
End Sub
Private Sub CenterPictureBox()
PictureBox1.Left = (Me.ClientSize.Width - PictureBox1.Width) \ 2
PictureBox1.Top = (Me.ClientSize.Height - PictureBox1.Height) \ 2
End Sub
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.