score:-1
may be this will help you...
How can I get all controls from a Form Including controls in any container?
once you have the list you can query'em
score:3
Something like this should work (not perfect code by any means...just meant to get the idea across):
public IEnumerable<Control> GetSelfAndChildrenRecursive(Control parent)
{
List<Control> controls = new List<Control>();
foreach(Control child in parent.Controls)
{
controls.AddRange(GetSelfAndChildrenRecursive(child));
}
controls.Add(parent);
return controls;
}
var result = GetSelfAndChildrenRecursive(topLevelControl)
.Where(c => c is TextBox || c is Checkbox);
Source: stackoverflow.com
Related Articles
- How can I query all Childcontrols of a Winform recursively?
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet'
- LINQ query to perform a projection, skipping or wrapping exceptions where source throws on IEnumerable.GetNext()
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- LINQ Source Code Available
- prevent unnecessary cross joins in count query of generated sql code
- .NET 4 Code Contracts: "requires unproven: source != null"
- EF Code First comparing null values generates strange query
- linq - how do you do a query for items in one query source that are not in another one?
- How can I write the following code more elegantly using LINQ query syntax?
- How to dynamic add filters to a LINQ query against an Odata Source in C#
- Avoid extra loop and could not find implementation of query pattern for source type int Select not found
- C# Linq query help removing foreach loops creating cleaner code
- Use a linq query as microsoft local report Data Source (WinForms)
- Can I use a compiled query as a source in a second query?
- Determine the source DataContext for a Linq to Sql query
- Query expressions over source type 'dynamic' or with a join sequence of type 'dynamic' are not allowed
- LINQ query returns old results when source list is re-initialized
- How to query by where clause with EF code first
- How to get SQL query into LINQ form in C# code
- Code Example for Add DateTime and TimeSpan in EF query
- Could not find an implementation of the query pattern for source type
- How can I code a Linq query to do an upward Include?
- creating Linq to sqlite dbml from DbLinq source code
- What would be a reasonably fast way to code this sql query in c#?
- Use winform checkbox to linq query
- Identify source of linq to sql query
- Recursively Query XML with Linq
- NHibernate LINQ query performance, which code fragment is better?
- Linq sub query when using a repository pattern with EF code first
- Avoiding duplicate code in Linq Select method
- Deleting rows with same foreign key but different primary key without affecting each other
- How to convert the property selector in Expression<Func<MyClass, int>>?
- Nested Lists in LINQ to SQL
- Casting errors when attempting to return an IQueryable<MyType>
- Compare two diferrent lists to Populate a third list
- TakeWhile, at least n elements
- Decrease 2 GB memory footprint of regex/linq or solve get distinct group values otherwise
- How to find point closest to 0,0 point with LINQ and C#
- How can I convert foreach loop to LINQ lambda
- find object from Tree or List Hierarchy
- casting a tiny int from SQL server
- Using Lambda OrderBy Comparer to give weight to a specific string value
- LINQ - Getting all child records from all parents
- How to display a Navigation Property of a table inside a Data control like a FormView?
- Multiple where conditions in EF using Lambda expressions
- I got a null reference exception on a Linq To SQL data context and I don't even really know where to start
- Explain LINQ All() expression
- Grouping Linq Issue, can't get it right
- Linq query two arrays for difference based on field comparison