Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub MyForm_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
- Try
- 'get height of title
- Dim titleHeight As Integer = RectangleToScreen(parent.ClientRectangle).Top - parent.Top
- 'set paddingTop to height of title + height of menustrip + 10px(can be whatever you want) padding
- Dim paddingTop As Integer = titleHeight + parent.MenuStrip1.Height + 10
- REM Adjust controls sized to scale based on new form size
- PictureBox1.Size = New Size(CInt(Width / 4), CInt(Height / 2))
- PictureBox1.Location = New Point(CInt(Width / 4 + PictureBox1.Width / 2), paddingTop)
- Catch ex As Exception
- MsgBox(ex.Message)
- End Try
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement