شرح لعملية form controls resize .. باستخدام - TopicsExpress



          

شرح لعملية form controls resize .. باستخدام خاصية ال anchor ولمن يريد استخدام الكود : Public Class Form1 Dim CW As Integer = Me.Width Current Width Dim CH As Integer = Me.Height Current Height Dim IW As Integer = Me.Width Initial Width Dim IH As Integer = Me.Height Initial Height Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load IW = Me.Width IH = Me.Height End Sub Private Sub Form1_Resize(sender As Object, e As System.EventArgs) Handles Me.Resize Dim RW As Double = (Me.Width - CW) / CW Ratio change of width Dim RH As Double = (Me.Height - CH) / CH Ratio change of height For Each Ctrl As Control In Controls Ctrl.Width += CInt(Ctrl.Width * RW) Ctrl.Height += CInt(Ctrl.Height * RH) Ctrl.Left += CInt(Ctrl.Left * RW) Ctrl.Top += CInt(Ctrl.Top * RH) Next CW = Me.Width CH = Me.Height End Sub End Class
Posted on: Fri, 05 Sep 2014 12:06:07 +0000

Trending Topics



Recently Viewed Topics




© 2015