private void btnRemove_Click(object sender, EventArgs e)
{
// Code to remove the selected value from the list
if (this.checkedListBoxRecordingName.Items.Count > 0)
{
int IndexToDelete = this.checkedListBoxRecordingName.SelectedIndex;
this.checkedListBoxRecordingName.Items.RemoveAt(IndexToDelete);
this.listBoxLocalAddr.Items.RemoveAt(IndexToDelete);
this.listBoxIPAddress.Items.RemoveAt(IndexToDelete);
this.listBoxPort.Items.RemoveAt(IndexToDelete);
if (this.checkedListBoxRecordingName.Items.Count > 0)
{
this.checkedListBoxRecordingName.SelectedIndex = this.checkedListBoxRecordingName.Items.Count - 1;
}
}
}