Beispiel #1
0
 private int GetLeftMargin(SAPbouiCOM.IForm pObjForm)
 {
     try
     {
         double lDblWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
         return((int)((lDblWidth / 2) - (pObjForm.Width / 2) + 100));
     }
     catch (Exception)
     {
         return(0);
     }
 }
Beispiel #2
0
 private int GetTopMargin(SAPbouiCOM.IForm pObjForm)
 {
     try
     {
         double lDblHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
         return((int)((lDblHeight / 2) - (pObjForm.Height / 2) - 100));
     }
     catch (Exception)
     {
         return(0);
     }
 }
Beispiel #3
0
 private void CenterForm(ref SAPbouiCOM.IForm pObjForm)
 {
     pObjForm.Left = GetLeftMargin(pObjForm);
     pObjForm.Top  = GetTopMargin(pObjForm);
 }