Hello
I have labels dynamically created for which i have this code to run when one is double clicked
I need to set the variable "ID" to the name of the dynamically created label that is clicked on so that it changes its color and the name is then passed to the next form but cant figure how i get it!Code:Private Sub label_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) For Each Labelname As Label In Me.Controls.OfType(Of Label)().ToArray If Labelname.Name.Substring(0, 3) = ID Then If Labelname.BackColor = Color.Yellow Then openbooking = True Dim f2 As BookingForm f2 = New BookingForm f2.Visible = True openbooking = True Else If MessageBox.Show("Mark as collected?", " ", _ MessageBoxButtons.OKCancel, MessageBoxIcon.Question) Then Labelname.BackColor = Color.Yellow Else End If End If End If Next End Sub End Class




Reply With Quote