如何在 vb.net 中以编程方式更改许多表单、文本框、按钮属性?

How Trick to change many form,textbox,button properties with programmatically in vb.net?

请帮助,我在 1 个表单中创建了 5 个表单、3 个文本框和 1 个按钮。我知道要更改控件属性。在示例中,我想将 FormBorderStyle 更改为 FixedSingle。下面是代码

Me.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedSingle

如果我使用 less form 没问题,有什么解决这个问题的技巧吗?就像更改所有表单、文本框和按钮属性的简单代码一样?有可能吗?

谢谢,任何回复都非常感谢! :)

为表单样式创建一个 Class

    Imports System
    Imports System.Windows.Forms
    Public Class FormStyle
        Public Sub FormCreation(frmName As Form)
            frmName.FormBorderStyle = FormBorderStyle.FixedSingle
        End Sub
    End Class

适用于

等所有形式
    Public Class Form1
        Dim frm As New FormStyle
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            frm.FormCreation(Me)
        End Sub
    End Class