In this post, I would like to explain briefly that how one can make user controls in C# Winforms The possibilities of creating own controls in C#, apart from the available out of the box controls are categorized as below Extended Controls, by deriving from an existing controlUserControl to create a control by grouping several other […]
Deserialize XML to Object C#
This post is about Deserialization of XML to the C# class object. Many a times, in coding we need to convert class to an XML and XML to a class object in our projects. Here we will see in detail about how C# deserialize xml file or xml string with samples. Below examples show reading […]
How To Select an XML Node Element Values According to a Specific Attribute Value – C#,VB.NET
Select XML Node Element Values According to a Specific Attribute Value:This article explains how to select individual XML element value from an XML file according to a specific attribute value using XPath expression. Consider the XML file below, Below samples will help you for accessing the Employee node’s internal elements according to the ID attribute […]
Exposing List as Property of Class in C#
Expose a generic List<T> as a property: As per Object Oriented Principles and .NET standards exposing field variables as a public is against the rule of encapsulation.Properties are defined to expose the field variables. Properties are defined to expose the field variables. It is simple to make primitive type data such as string and int variables […]
Iterating recursively through menustrip items in C#.NET
Iterating Through Menustrip Items: There might be many cases and requirements to loop through all menu items in a menustrip Control. So, How to iterate recursively through all menu items in a menustrip control? The following is a sample method to help you in iterating through menustrip items.You can use these methods in the same class or can be […]
How To Select Required Number Of Nodes From Top or Bottom Using XPATH – C#,VB.NET
In this post, I am explaining how you can access only the specified number of required XML elements using the XPATH expression.The Same sample is given in both C# and VB.NET. Consider the same XML sample file which I have used for my other sample codes, Select Required Number of Nodes From Top or Bottom […]