我可以在.vb中维护vb.net windows表单设计器代码吗?

时间:2016-05-01 06:13:00

标签: vb.net winforms

我可以在.vb中维护vb.net windows窗体设计器代码吗?

即我想问一下我是否只能为表单设计和逻辑部分维护一个.vb文件,而不是为表单设计部分设置一个designer.vb而为逻辑部分设置.vb文件?

1 个答案:

答案 0 :(得分:0)

这是一个功能样本:

_     部分类Form1         继承System.Windows.Forms.Form

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    Public Sub Intiialize()

        'Form overrides dispose to clean up the component list.

        InitializeComponent()


    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    End Sub
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        components = New System.ComponentModel.Container()
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.Text = "Form1"
    End Sub


End Class