اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

كود توسيط نمودج على جميع الشاشات


jamal2080

الردود الموصى بها

Dim frm As Form
Dim intScreenWidth As Integer
Dim intScreenHeight As Integer
Dim intFormWidth As Integer
Dim intFormHeight As Integer
Dim intLeft As Integer
Dim intTop As Integer

' احضار مرجع للنموذج الحالي
Set frm = Screen.ActiveForm

' الحصول على عرض الشاشة وارتفاعها
intScreenWidth = Screen.Width / Screen.twipsPerPixelX
intScreenHeight = Screen.Height / Screen.TwipsPerPixelY

' الحصول على عرض وارتفاع النموذج
intFormWidth = frm.Width / frm.ScaleX
intFormHeight = frm.Height / frm.ScaleY

' حساب الموضع الأفقي المتوسط
intLeft = (intScreenWidth - intFormWidth) / 2

' حساب الموضع الرأسي المتوسط
intTop = (intScreenHeight - intFormHeight) / 2

' تعيين الموضع الجديد للنموذج
frm.Move intLeft * frm.ScaleX, intTop * frm.ScaleY

 

تم تعديل بواسطه jamal2080
للون خظ
  • Like 1
رابط هذا التعليق
شارك

في 16‏/9‏/2023 at 15:32, jamal2080 said:
Dim frm As Form
Dim intScreenWidth As Integer
Dim intScreenHeight As Integer
Dim intFormWidth As Integer
Dim intFormHeight As Integer
Dim intLeft As Integer
Dim intTop As Integer

' احضار مرجع للنموذج الحالي
Set frm = Screen.ActiveForm

' الحصول على عرض الشاشة وارتفاعها
intScreenWidth = Screen.Width / Screen.twipsPerPixelX
intScreenHeight = Screen.Height / Screen.TwipsPerPixelY

' الحصول على عرض وارتفاع النموذج
intFormWidth = frm.Width / frm.ScaleX
intFormHeight = frm.Height / frm.ScaleY

' حساب الموضع الأفقي المتوسط
intLeft = (intScreenWidth - intFormWidth) / 2

' حساب الموضع الرأسي المتوسط
intTop = (intScreenHeight - intFormHeight) / 2

' تعيين الموضع الجديد للنموذج
frm.Move intLeft * frm.ScaleX, intTop * frm.ScaleY

من فضلك لو وقتك يسمح تعمل لنا مثال 

  • Like 1
رابط هذا التعليق
شارك

من فضلك سجل دخول لتتمكن من التعليق

ستتمكن من اضافه تعليقات بعد التسجيل



سجل دخولك الان
  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information