Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I would like to find the listview dropdown control but i am enable to find control due to there dynamic id ,my control id is "dlty"

Thanks
Posted

1 solution

Check out Control.Controls Property[^].

From a Form control, you can find your ListBox control.
C#
Control f = (from c in this.Controls
             where c.Name == "dlty"
             select c).FirstOrDefault();

if (f is ListBox)
{
  // Found the ListBox with name "dlty"
}
 
Share this answer
 
Comments
Espen Harlinn 22-Jan-12 7:53am    
Yes, pretty nice solution - 5'ed!
Kim Togo 22-Jan-12 8:11am    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900