19-11-18, 05:09 PM
تفضل
ضع هاذا التعريف فوق الفروم لود
وفي الفروم لود ضع هاذا الكود
سوف تكون مرتبة الادوات فقط ماعدى النصوص سااعمل لك مثال على ذالك
ضع هاذا التعريف فوق الفروم لود
كود :
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سوف تكون مرتبة الادوات فقط ماعدى النصوص سااعمل لك مثال على ذالك
