Home > Net >  Determine whether a particular control exist
Determine whether a particular control exist

Time:11-27

Use control the contains of function

For example: whether in called panel3 picturebox control of dynamically add label (dynamically added when using LabelWorkCount (I) as a deposit label information array)
Is to determine whether a label in the array exists available

Private LabelWorkCount (139), the As System. Windows. Forms. Label

For I=0 to LabelWorkCount. Length - 1

If panel3. The Contains (LabelWorkCount (I)) then

Msgbox (" exist ")
The else

Msgbox (" does not exist ")
End the if

next
  • Related