C
Carlo
Hi
I am trying to add a checkbox programmatically next to a list box but
with each new item added to the list box it should have a
corresponding checkbox. I therefore tried to use a variable for the y
co-ordinate to the control. The initial value should be 13 and then
should increment by 17 for each additional checkbox but the code below
does not give me what I want. Please help:
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
Dim MyChkBox As New CheckBox()
Dim m As Integer
lstTally.Items.Add(String.Format(fmtstr,
FormatNumber(txtInput.Text)))
total += txtInput.Text
ShowTotal(total)
MyChkBox.Location = New Point(96, m + 13)
Me.Controls.Add(MyChkBox)
m = m + 17
End Sub
Thanks
Carlob1
I am trying to add a checkbox programmatically next to a list box but
with each new item added to the list box it should have a
corresponding checkbox. I therefore tried to use a variable for the y
co-ordinate to the control. The initial value should be 13 and then
should increment by 17 for each additional checkbox but the code below
does not give me what I want. Please help:
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
Dim MyChkBox As New CheckBox()
Dim m As Integer
lstTally.Items.Add(String.Format(fmtstr,
FormatNumber(txtInput.Text)))
total += txtInput.Text
ShowTotal(total)
MyChkBox.Location = New Point(96, m + 13)
Me.Controls.Add(MyChkBox)
m = m + 17
End Sub
Thanks
Carlob1