I am trying to generate a new checkbox in a different form.
Public Class frmAdd
Public Sub btnitemadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnitemadd.Click
Dim chklowerleft As New CheckBox
Dim chkhandleft As New CheckBox
Dim indexcounter As Integer = 4
If chkleftlowerarm.Checked = True Then
frmMain.chklistLA.Items.Add(chklowerleft, False)
frmMain.chklistLA.Items.Item(2) = ("Lower Arm Actuator")
End If
If chkhand.Checked = True Then
frmMain.chklistLA.Items.Add(chklowerleft, False)
frmMain.chklistLA.Items.Item(2) = ("Lower Arm Actuator")
frmMain.chklistLA.Items.Add(chkhandleft, False)
frmMain.chklistLA.Items.Item(3) = ("Hand Actuator")
End If
Me.Close()
End Sub
End Class
While this is great for things like those added, it may make things a bit difficult removing items down the road. Is there an easier way to name things generated?