/images/myAvatar200.png

Retrieve all controls using generics (II)

Gettings all controls from a container v2 A better approach In my previous post I created a recursive function to retrieve all controls inside a form and its containers. Today, my colleague and friend Eduard Tomàs sent me another solution to the same topic based on LINQ. It’s simply and really, really pretty ❤️ The power of LINQ Before starting, we need to solve this: LINQ works over IEnumerable, but Control.

Retrieve all controls using generics (I)

Gettings all controls from a container That’s the question How many times have you ever heard something similar? :) How to clear the content of all the textboxes in a form? The question may vary a littles bit but it’s always related to obtain all controls of a determined type (Button TextBox, etc) in a form or maybe in another type of container like a Panel or user control. Generics and Extension methods Using generics it’s really easy!

Extended shortcodes

Tables Tables Are Cool col 1 is left-aligned $1600 col 2 is centered $12 col 3 is right-aligned $1 Gist Admonition admon samples This is a bug A tip banner Or This is a tip A tip banner Mermaid mermaid samples Flow Gaant git pie eCharts echarts samples Line chart Map