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

شاشات الحواسيب


jamal2080

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

كيفية جعل صفحة عرض مناسبة مع جميع شاشات الحواسيب

 

ضع هاذا التعريف فوق الفروم لود

 

 

Dim ProportionsArray() As CtrlProportions

وفي الفروم لود ضع هاذا الكود

  Informload()

  End Sub
  Private Structure CtrlProportions
      Dim HeightProportions As Single
      Dim WidthProportions As Single
      Dim TopProportions As Single
      Dim LeftProportions As Single
  End Structure
  Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize

      Resizeform()

  End Sub


  Sub Informload()

      On Error Resume Next

      Application.DoEvents()

      ReDim ProportionsArray(0 To Controls.Count - 1)

      For I As Integer = 0 To Controls.Count - 1

          With ProportionsArray(I)
              .HeightProportions = Controls(I).Height / Height
              .WidthProportions = Controls(I).Width / Width
              .TopProportions = Controls(I).Top / Height
              .LeftProportions = Controls(I).Left / Width

          End With
      Next

  End Sub

  Public Sub Resizeform()

      On Error Resume Next

      For I As Integer = 0 To Controls.Count - 1

          Controls(I).Left = ProportionsArray(I).LeftProportions * Me.Width
          Controls(I).Top = ProportionsArray(I).TopProportions * Me.Height
          Controls(I).Width = ProportionsArray(I).WidthProportions * Me.Width
          Controls(I).Height = ProportionsArray(I).HeightProportions * Me.Height
      Next

 

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

في 9‏/3‏/2023 at 23:48, abouelhassan said:

ممكن حضرتك ترفق لنا مثال بارك الله فيك

تفضل اخي ابو الحسن @abouelhassan

هذا مثال لطيف من احد المواقع ولايحتاج لاستدعاء دوال API لكنه يحتاج الى تدريب قليلا

لان يحتاج الى التعامل مع ال Tag لكل عنصر موجود في النموذج

PDTech_FormResizer_code.rar

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

1 ساعه مضت, ابو فتحى said:

ممكن نسخة 2003 من فضلك

تفضل..حينما تفتح النماذج ..انظر الى ال Tag لكل عنصر

في اعتقادي ..الكود فعال جدا لكن يحتاج الى ممارسة

PDTech_FormResizer_code.rar

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

 

في 13‏/3‏/2023 at 17:42, Eng.Qassim said:

تفضل اخي ابو الحسن @abouelhassan

هذا مثال لطيف من احد المواقع ولايحتاج لاستدعاء دوال API لكنه يحتاج الى تدريب قليلا

لان يحتاج الى التعامل مع ال Tag لكل عنصر موجود في النموذج

PDTech_FormResizer_code.rar 55.52 kB · 17 downloads

اشكرك اخى مهندس قاسم زادك الله من فضله

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

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