Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Visual Basic Programming Code Examples

Visual Basic > Forms Code Examples

Center a form on the screen

Center a form on the screen Declare this Subroutine in General Declarations: Public Sub SubFrmCntr(CurrentForm as Form) CurrentForm.Move (Screen.Width - CurrentForm.Width) \ 2, (Screen.Height - CurrentForm.Height) \ 2 Load CurrentForm CurrentForm.show End Sub 'Then, When you want to center a form: SubFrmCntr(ME) ' Since me is the object name of the current form Return