|
-
Nov 8th, 2000, 07:10 AM
#1
Thread Starter
Addicted Member
I can resize the form, but how do I recenter the form on the screen once I do so?
Thanks.
-Git
-
Nov 8th, 2000, 07:13 AM
#2
Member
' Centres a form either on the screen (default) or over another form
Public Sub CentreForm(Optional varMoveForm As Variant, Optional varRefForm As Variant)
Dim frmMoveForm As Form
If IsMissing(varMoveForm) Or Not TypeOf varMoveForm Is Form Then
Set frmMoveForm = Screen.ActiveForm
Else
Set frmMoveForm = varMoveForm
End If
With frmMoveForm
If IsMissing(varRefForm) Or TypeOf varRefForm Is Screen Then
.Move (Screen.Width - .Width) / 2, (Screen.Height - .Height) / 2
ElseIf TypeOf varRefForm Is Form Then
.Move varRefForm.Left + (varRefForm.Width - .Width) / 2, varRefForm.Top + (varRefForm.Height - .Height) / 2
End If
End With
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|