Hello Everyone
So i have this flowlayoutpanel that contains checkboxes, so what It does is if a select a checkbox the text of that checkbox will be passed to the ProblemTextBox
My main problem is that I am able to add new checkboxes to the ProblemTextBox, but when i uncheck a textbox I want it to delete that text from the ProblemTextBox
In Example If i check 'PM, MECHANICAL, ERROR' i will the following in the Problems TextBox
PM, MECHANICAL, ERROR
But if I uncheck 'MECHANICAL', I'm unable to delete that word and have something like this
PM, ERROR
So here is the code that im using for that problem, thanks in advance guys
Public Sub DoCheckBox(ByVal selected As String, ByVal status As Boolean)
If status = True Then
If ProblemTextBox.Text <> "" Then
ProblemTextBox.Text += " " + selected
Else
ProblemTextBox.Text = selected
End If
Else
If ProblemTextBox.Text <> "" Then
If ProblemTextBox.Text.Contains(selected) = True Then
'??? what goes here
End If
'ProblemTextBox.Text += " " + btn.Text
Else
ProblemTextBox.Text = selected
End If
End If
End Sub