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

تعديل كود لضبط اعدات الشاشة


esam munir

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

السلام عليكم ورحمة الله وبركاتة 

ارجو من حضراتكم المساعدة فى تعديل هذا الكود لضبطة بما يتناسب مع 64 بت بدلا من 32 بت او النظر فى الخطأ وتعديلة .

ولكم منا كل الشكر والتقدير 

Option Compare Database

Declare Function DisplaySize Lib "user32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long

Function resizefrom(frm As Form, bestw As Integer, besth As Integer)

On Error Resume Next

wrate = DisplaySize(0) / bestw

hrate = DisplaySize(1) / besth

frm.InsideWidth = frm.InsideWidth * wrate

frm.InsideHeight = frm.InsideHeight * hrate

Dim fc As Control

For Each fc In frm.Controls

fc.Top = fc.Top * hrate

fc.Left = fc.Left * wrate

fc.Width = fc.Width * wrate

fc.Height = fc.Height * hrate

fc.FontSize = fc.FontSize * wrate

Next

End Function
 

WhatsApp Image 2021-05-08 at 2.10.05 PM.jpeg

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

4 ساعات مضت, esam munir said:

السلام عليكم ورحمة الله وبركاتة 

ارجو من حضراتكم المساعدة فى تعديل هذا الكود لضبطة بما يتناسب مع 64 بت بدلا من 32 بت او النظر فى الخطأ وتعديلة .

ولكم منا كل الشكر والتقدير 

Option Compare Database

Declare Function DisplaySize Lib "user32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long

Function resizefrom(frm As Form, bestw As Integer, besth As Integer)

On Error Resume Next

wrate = DisplaySize(0) / bestw

hrate = DisplaySize(1) / besth

frm.InsideWidth = frm.InsideWidth * wrate

frm.InsideHeight = frm.InsideHeight * hrate

Dim fc As Control

For Each fc In frm.Controls

fc.Top = fc.Top * hrate

fc.Left = fc.Left * wrate

fc.Width = fc.Width * wrate

fc.Height = fc.Height * hrate

fc.FontSize = fc.FontSize * wrate

Next

End Function
 

WhatsApp Image 2021-05-08 at 2.10.05 PM.jpeg

تقريباً الدالة المستخدمة متوافقة مع اكسس 32 بت وحضرتك تستخدم 64 بت .

فبحث عن كود متوافق مع نسخة الاكسس خاصتك واعتذر على عدم وضع كود متوافق معك لانني من مستخدمين النسخة 32

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

السلام عليكم

مشاركه مع الاستاذ كريم

جرب الكود  بعد التعديل وهو باضافه PtrSafe


Option Compare Database

Declare PtrSafe  Function DisplaySize Lib "user32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long

Function resizefrom(frm As Form, bestw As Integer, besth As Integer)

On Error Resume Next

wrate = DisplaySize(0) / bestw

hrate = DisplaySize(1) / besth

frm.InsideWidth = frm.InsideWidth * wrate

frm.InsideHeight = frm.InsideHeight * hrate

Dim fc As Control

For Each fc In frm.Controls

fc.Top = fc.Top * hrate

fc.Left = fc.Left * wrate

fc.Width = fc.Width * wrate

fc.Height = fc.Height * hrate

fc.FontSize = fc.FontSize * wrate

Next

End Function

 

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

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