الاخوة اعضاء المنتدى
ارجو مساعدتى فى كود ضبط الفورم على الشاشة تلقائيا
بحيث يتم ضبط الفورم تلقائيا حسب مقاس الشاشة
سواء 1024 × 768 أو 1024 × 1280 أو 1024 × 768 أو 600× 800
وجزاكم الله خير الجزاء
الاخوة اعضاء المنتدى
ارجو مساعدتى فى كود ضبط الفورم على الشاشة تلقائيا
بحيث يتم ضبط الفورم تلقائيا حسب مقاس الشاشة
سواء 1024 × 768 أو 1024 × 1280 أو 1024 × 768 أو 600× 800
وجزاكم الله خير الجزاء
إن كانت النفوس كباراً **** تعبت في مرداها الأجسام
.:: علي العامر ::.
مبرمج أكسس وفيجوال يبلغ من العمر 16 سنة
جزاك الله خيرا أخى على
على هذا المرفق
ونضيف هذه الروابط للاستفاده
إعادة تحجيم النموذج وفقاً لشاشة المستخدم وليس العكس
وحدات قياس الشاشة ونقاط شاشة العرض
تمنياتى لكم وللجميع بالتوفيق ودوام النجاح
اشكر كل من شارك ولكن هل من طريقة لتغير دقة الشاشة تلقائيا حسب ما يناسب البرنامج و اعادة بتها كما كانت بعد الخروج
اخي الكريم
لتوسيط اي فورم في وسط الشاشة عن طريق الكود , بأي دقة كانت استدعي هذه الوحدة النمطية ولتكن بأسم Centerfrm في حدث عند الفتح للنموذج :
Call gfncCenterForm(Me)
الوحدة النمطية :
Option Compare Database
' API declarations:
Private Declare Function apiGetClientRect Lib "user32" Alias "GetClientRect" (ByVal hwnd As Long, lpRect As typRect) As Long
Private Declare Function apiGetWindowRect Lib "user32" Alias "GetWindowRect" (ByVal hwnd As Long, lpRect As typRect) As Long
Private Declare Function apiSetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function apiShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
' Type declarations:
Private Type typRect
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
' Constant declarations:
Private Const SW_RESTORE = 9
Private Const SWP_NOSIZE = &H1 ' Don't alter the size
Private Const SWP_NOZORDER = &H4 ' Don't change the Z-order
Private Const SWP_SHOWWINDOW = &H40 ' Display the window
' **************************************
' * Center a form in the Access window *
' **************************************
' Created 1-22-2002 by Peter M. Schroeder
Public Function gfncCenterForm(parForm As Form) As Boolean
Dim varAccess As typRect, varForm As typRect
Dim varX As Long, varY As Long
On Error GoTo CenterForm_Error
Call apiGetClientRect(hWndAccessApp, varAccess) ' Get the Access client area coordinate
Call apiGetWindowRect(parForm.hwnd, varForm) ' Get the form window coordinates
varX = CLng((varAccess.Left + varAccess.Right) / 2) - CLng((varForm.Right - varForm.Left) / 2) ' Calculate a new left for the form
varY = CLng((varAccess.Top + varAccess.Bottom) / 2) - CLng((varForm.Bottom - varForm.Top) / 2) ' Calculate a new top for the form
varY = varY - 10 ' Adjust top for true center
varY = varY - 20 ' Adjust top for appearance
Call apiShowWindow(parForm.hwnd, SW_RESTORE) ' Restore form window
Call apiSetWindowPos(parForm.hwnd, 0, varX, varY, (varForm.Right - varForm.Left), (varForm.Bottom - varForm.Top), SWP_NOZORDER Or SWP_SHOWWINDOW Or SWP_NOSIZE) ' Set new form coordinates
gfncCenterForm = True
Exit Function
CenterForm_Error:
gfncCenterForm = False
End Functionويمكن التحكم بهذا التوسيط بتغيير القيم في هذا الجزء من الكود في الوحدة النمطية :
varY = varY - 10
varY = varY - 20----------------------------------
أبو منتظر
المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية
جارٍ التحقق من المتواجدين…