VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > VB.net教程 >
  • vb.net教程之自动调整窗体

0.    自动调整窗体

 
    Public xz, yz As Double
    Public Sub zishiying(ByVal parent As Control)
        xz = 75 / Form5.Button1.Width
        yz = 23 / Form5.Button1.Height
        Dim sFont As Font
        For Each c As Control In parent.Controls
            Dim zihao As Integer = c.Font.Size * xz / 1.2 \ 1
            sFont = New Font(c.Font.FontFamily, zihao, c.Font.Style)
            c.Font = sFont
            c.Width = c.Width * xz
            c.Height = c.Height * yz
            c.Left = c.Left * xz
            c.Top = c.Top * yz
            zishiying(c)
        Next
    End Sub
 
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        zishiying(Me)
    End Sub

相关教程