Rutina que permitira centrar un formulario en las distintas resoluciones de la pantalla o formulario MDI.
Public Sub S_Centrar_Formulario(f As Form)
Dim nLeft As Integer
Dim nTop As Integer
nTop = Int(((MDIInicio.Height - 600) - f.Height - 200) / 2)
If nTop < 0 Then
nTop = 0
End If
f.Top = nTop
nLeft = Int((MDIInicio.Width - f.Width - 200) / 2)
If nLeft < 0 Then
nLeft = 1
End If
f.Left = nLeft
End Sub
|