01-05-14, 10:14 AM
اخي العزيز ربما تجد ما ينفعك في هذا الكود .... علما انه يعمل على ضبط الرزليوشن للكونترولز الموجودة على الفورم .... تضعه في حدث التحميل للفورم
كود :
Dim DesignScreenWidth As Integer = 1600
Dim DesignScreenHeight As Integer = 1200
Dim CurrentScreenWidth As Integer = Screen.PrimaryScreen.Bounds.Width
Dim CurrentScreenHeight As Integer = Screen.PrimaryScreen.Bounds.Height
Dim RatioX as Double = CurrentScreenWidth / DesignScreenWidth
Dim RatioY as Double = CurrentScreenHeight / DesignScreenHeight
For Each iControl In Me.Controls
With iControl
If (.GetType.GetProperty("Width").CanRead) Then .Width = CInt(.Width * RatioX)
If (.GetType.GetProperty("Height").CanRead) Then .Height = CInt(.Height * RatioY)
If (.GetType.GetProperty("Top").CanRead) Then .Top = CInt(.Top * RatioX)
If (.GetType.GetProperty("Left").CanRead) Then .Left = CInt(.Left * RatioY)
End With
Next
