VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Center a control (button, textbox, ...) on a form.

by Waterfall (4 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Sun 12th December 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Center a control (button, textbox, ...) on a form.

API Declarations


'CenterCtrlX Form1.Command1
'// and / or
'CenterCtrlY Form1.Command1

Rate Center a control (button, textbox, ...) on a form.



    Ctrl.Left = (Me.ScaleWidth - Ctrl.Width) / 2
End Sub
Private Sub CenterCtrlY(Ctrl As Control)
    Ctrl.Top = (Me.ScaleHeight - Ctrl.Height) / 2
End Sub


Download this snippet    Add to My Saved Code

Center a control (button, textbox, ...) on a form. Comments

No comments have been posted about Center a control (button, textbox, ...) on a form.. Why not be the first to post a comment about Center a control (button, textbox, ...) on a form..

Post your comment

Subject:
Message:
0/1000 characters