Advertisement
kshadow22

Form Back To Center Visual Basic

Sep 5th, 2015
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FUNCTION____________________________________
  2.  Dim screenWidth As Integer = Screen.PrimaryScreen.Bounds.Width
  3.         Dim screenHeight As Integer = Screen.PrimaryScreen.Bounds.Height
  4.         Dim formNewLeft As Integer = Val(Val(screenWidth) / Val(2)) - Val(Val(Me.Width) / Val(2))
  5.         Dim formNewTop As Integer = Val(Val(screenHeight) / Val(2)) - Val(Val(Me.Height) / Val(2))
  6.         Me.Left = formNewLeft
  7.         Me.Top = formNewTop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement