اذهب الي المحتوي
أوفيسنا

مساعدة في ماكرو moveandsizewindow


Radwan0

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

السلام عليكم اخواني

كيف بامكاني تحديد القيم هنا بحيث ياخذ النموذج وسط الشاشة

انا استعمل هذا الكود لاني قمت باخفاء "التفصيل" ويظهر بعد اعطاء امر 

لكن المشكلة ان النموذج يختفي فاستدليت على هذه الطريقة باظهار النموذج لكن احتاج لمعرفة القيم التي تعطي النموذج وسط الشاشة 

1646572654565.png

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

وعليكم السلام 🙂

 

ما فهمت قصدك في سبب اختفاء النموذج !!

 

اما بالنسبة الى الامر MoveandSize ن فيجب ادخال القيم تويبس Twips ، وهذا يعتمد على اعدادات الوندوز في جهازك ،

1 سم = 567 تويبس

1 بوصة = 1440 تويبس

1 بكسل = 15 تويبس

 

وهذه الوحدة النمطية تعطيك حجم الشاشة بالبكسل:

Option Compare Database
Option Explicit

Type RECT
   x1 As Long
   y1 As Long
   x2 As Long
   y2 As Long
End Type


#If VBA7 Then

    Declare PtrSafe Function GetDesktopWindow Lib "user32" () As LongPtr
    Declare PtrSafe Function GetWindowRect Lib "user32" (ByVal hwnd As LongPtr, lpRect As RECT) As Long
    
    Dim hwnd As LongPtr
    
#Else

    Declare Function GetDesktopWindow Lib "user32" () As Long
    Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, rectangle As RECT) As Long
    
    Dim hwnd As Long
    
#End If


Function GetScreenResolution() As String

   Dim R As RECT
   'Dim hwnd As Long
   Dim RetVal As Long

   hwnd = GetDesktopWindow()
   RetVal = GetWindowRect(hwnd, R)
   GetScreenResolution = (R.x2 - R.x1) & "x" & (R.y2 - R.y1)
    
End Function

.

جعفر

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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

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

Important Information