0

Hey, i'm recently new in this forum, so if i'm doing something wrong, please tell me!
I have a problem that is driving me nuts!

Here's the thing, i want to know if there is any way of remove checkboxes dynamically, with code. I know that there is a way to add them, but i dont know how to remove them!

To add them, i have this code:

Me.Controls.Add(ChkBox)
ChkBox.Location = New Point(offsetWidht, offsetHeight)
ChkBox.Text = sqlRead.Item(1).ToString
ChkBox.Name = sqlRead.Item(0).ToString

There is any code to do the opposite, to remove them?

Best regards,

Rafael Sousa

1
Contributor
1
Reply
8
Views
2 Years
Discussion Span
Last Post by RafaelSousa.13
0

Greetings!

Actually i found a solution!

This is the code that i used to solve this. (in case anyone else has the same problem!)

While sqlRead.Read()
Me.Controls.RemoveByKey(sqlRead.Item(0).ToString)
End While

This worked for the code i was developing.

Best regards,

Rafael Sousa

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.