Programmatically add controls to form

后端 未结 3 1749
被撕碎了的回忆
被撕碎了的回忆 2021-01-24 07:22

I\'m using the attached code to add another line\\row of controls beneath an existing set (when a label is clicked). There could be quite a few rows added so I\'m having to repe

3条回答
  •  猫巷女王i
    2021-01-24 07:40

    I don't know if there's a "less code" approach to this but I do know that you can save your fingers using a With statement.

        Dim RadioButton5 As New RadioButton
        With RadioButton5
            .AutoSize = True
            .Checked = True
            .Location = New System.Drawing.Point(77, 112)
            .Name = "RadioButton5"
            .Size = New System.Drawing.Size(55, 17)
            .TabIndex = 48
            .TabStop = True
            .Text = "NEAR"
            .UseVisualStyleBackColor = True
        End With
    

提交回复
热议问题