This article explains the sample C# code with XPathNavigator to select an XML element from an XML file which is having a default namespace.Consider the sample XML file with namespace(xmlns) defined , See the console application sample given below which selects all the City Elements of the State which is having Name attribute value ‘Karnataka’.XPathNavigator […]
String Value Enum with Space in between – Description Attribute
Enum with spaces C#: If you give a space in string value of Enum, it would generate a compilation error. Single-word enum string value is a normal scenario and straightforward handle. But, how to have an enum string value with multiple words Enum values with spaces in C# Normally, the name of an enum in […]
What Is SetCompatibleTextRenderingDefault (false)
This article is just to give you a brief idea about SetCompatibleTextRenderingDefault and what happens if we pass true instead of false. What is UseCompatibleTextRendering property? | What Is SetCompatibleTextRenderingDefault? If you’re using Visual C# 2005 or later, the Program.cs file will generate an automatic call to SetCompatibleTextRenderingDefault. In order to ensure visual consistency between Windows […]
How To Create Custom Control in C# Windows Forms
Custom controls are specialized controls in .NET derived from Control class. In this article, we explain the step by step process of creating a custom control in C# WinForms application. Custom Control in C# Winforms We can have the following types of Custom Controls in C# or VB.NET Usercontrols Usercotrols are the simpler form of custom controls […]
Difference between Custom Controls,User controls and Components in C#.NET
Difference between Custom Controls, User controls and Components in C#: Both User control and custom control are direct or indirect derivations of Control class. Control, in turn, is derived from the component.See the derivation in below lines. public class Component : MarshalByRefObject, IComponent, IDisposable public class Control : Component, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent,IComponent, IDisposable From this, […]
How to debug C# Winforms User controls at Design Time
This article is to guide you in Debugging C# Windows Forms Usercontrols at Design Time. If you are creating a user control you may be required to debug the user control during design time to ensure the user control will function as expected while in use. This article explains the steps in detail to help you debug […]