C# Programming Tutorials

C Sharp Programming Tutorials And Articles
  Title / Author Reverse Sort Order Replies
To start with include namespaces using System.Diagnostics; // For prcesss related information using System.Runtime.InteropServices; // For DLL importing Now declare these variables private const int SW_HIDE = 0; Now declare win32 function ShowWindow
When I started on Drag and Drop in C# I could not find much on the net and so I have decided to tackle the problem here. First follow the steps to see the working sample. 1. Create a new C sharp windows application. Rename Form1 to a suitable name. I would refer it as TestForm 2. Add a treeview...
Introduction Sometimes you have data with a 1:1 relationship between the key and values and you need to put them into a Hashtable for easy retrieval and later realize you need to look up the keys from the values in the table. I came across such a problem for a combo box item displayed and actual...
Introduction The parser gives you a place to start to write an XML parser in C#. We have used the System.Xml. The code public void ParseFile(string strPath) { XmlTextReader xmlReader = new XmlTextReader(strPath); int iTab = 0;
Delegate.Invoke Delegate.Invoke is used to execute a delegate on the current thread. A delegate is just a reference to a function or method, and Delegate.Invoke is the mechanism to call this function or method (similar to a normal function call). Delegate.BeginInvoke Delegate.BeginInvoke...
Introduction I happen to edit the collections many times in the foreach loop and run into problems and then each time I got a different solution when going to Google, So first I would try to list each of the solution and then discuss them so that we all can have the best practice in the...
Any software application, two of the most frequently done tasks are formatting and parsing the data. In simplest words, formatting refers to the process of converting some type to string and conversely parsing refers to converting string into some other data type. There are several techniques that...
Garbage collection and memory management is probably that domain of programming where .NET Framework beats most of the other application development platforms. Most of the time, garbage collection is automatically done by .NET runtime once the object gets out of scope. When a .NET object is not...
.NET Framework comes with a set of debugging tools. Particularly if you are using and advanced IDE such as Visual Studio, you can use debugger and other diagnostic tools available in the IDE. This debugging, however, is only applicable during the development of the application. Once the application...
Often times, applications need to perform multiple tasks at a time. I always share Microsoft’s word processor’s example. While you type in the word processor, the application lets you type and in the meantime it is running spell-check and dictionary in the background to inform you whenever you type...
In my last article, Complete Threading Tutorial in C#, I explained basics of threading. I explained that how threads can be created, how locking is implemented to make your applications thread-safe and how exception handling is implemented in threaded applications. This article explains some more...
In my last tutorial on basics of threading, I explained what threading basically is and how it is actually implemented in C#. I would advise you to have a look at it before continuing with this article or if you have an Idea of what threads actually are, you can continue with this article. Writing...
Most of the advanced .NET applications that you develop need to communicate with other applications. For instance, for downloading or uploading data to some remote server, networking is required. In order to send or receive email via SMTP or to send and receive webpages via an HTTP protocols, some...
Most of the time, a developer needs to read or write data from a location outside the memory of the program. This location can be a text file, a network connection a database or any other source of data. In order to deal with such sources of information, .NET Framework provides a set of classes...
WPF (Windows Presentation Foundation) is a Microsoft’s technology for creating rich client applications. WPF applications are more interactive, aesthetic and flexible as compared to their traditional counter parts The Windows Form applications. WPF is a subset of Microsoft’s famous .NET framework. ...
Grid layout is one of the most widely used layouts in any WPF application. The basic concept of a Grid is that it divides the window surface into grids of invisible rows and columns to which other controls or layouts can be added. Grids are usually invisible but can be made visible for debugging...
A WPF Window is integration of multiple elements. Top level elements such as Window, layout containers such as StackPanel, DockPanel, Grid etc. and control elements such as text boxes, buttons, menu bars and tool bars etc. All the control elements in WPF derive from System.Windows.Control base...
WPF content controls are a specialized form of WPF controls and are used to store content either entered by the user or read from any other data source. Content controls can contain only one child element. This is unlike layout controls such as Grid, WrapPanel and StackPanel controls that contain...
Specialized containers are a variant of content controls but unlike content controls which can hold simple content type such as string or UIElement object, the specialized containers has larger impact and they affect the outlook of the larger portion of content visible on the screen. In this...
Almost every software application has to deal with some sort of text information. This information can be the content of some email, a network message or some input value obtained from the user. WPF contains Text controls for this purpose that can be used to get input from the user. Similarly, to...