| {\rtf1\ansi\ansicpg1252\deff0\deflang1044{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 The following code centers a form within a form. This is useful in MDI projects as you can't set the StartUpPosition of child forms. \par \par \par 'Purpose : Centers a form within a form \par 'Inputs : oFrmOwner The form to center in (i.e. the MDI form) \par ' oFrmChild The form to center (i.e. the MDI child form). \par 'Outputs : N/A \par 'Author : Andrew Baker \par 'Date : 23/07/2000 18:52 \par 'Notes : \par 'Revisions : \par \par Sub FormCenter(oFrmOwner As Form, oFrmChild As Form) \par oFrmChild.Left = (oFrmOwner.ScaleWidth / 2) - (oFrmChild.Width / 2) \par oFrmChild.Top = (oFrmOwner.ScaleHeight / 2) - (oFrmChild.Height / 2) \par End Sub \par } |
Centering a form within a form |
India web developer web development India | India web development company India ecommerce web developer