C# Application Programming



All articles and source code are under the Visual C# Kicks license agreement

WinForms

Hide Articles

Aspect Ratio Form
  • 3.9/5
Create C# Windows Form that keeps its aspect ratio as it is being resized without any flickering.

Vista-Style Task Dialog
  • 3.86/5
Integrate the visually-appealing TaskDialog Vista control into your C# applications, which works even on old versions of Windows.

Splash Screens
  • 3.83/5
Add a splash screen to C# applications based on any kind of image, shadows and transparency fully supported.

Angle and Altitude User Controls
  • 3.82/5
Two clean user controls written in C# to mimic the Photoshop angle and altitude selectors.

WinForm Resize Animation
  • 3.78/5
Applying concepts of WinForm animation to create a smooth resizing animation effect.

Numbers-Only Textbox
  • 3.68/5
Different ways to allow users to only write numbers in a Windows Form Textbox.

Aero Shake Form
  • 3.67/5
Implement the new Window 7 Aero Shake feature in C# Windows Forms with simple .NET code.

Click-and-Drag Form
  • 3.63/5
By using various Form events and some adding and subtracting, one can create the same effect of a windows titlebar.

Custom Control Properties
  • 3.58/5
Enhance your custom user controls by customizing the way the designer displays the custom properties of the control.

Clipboard Event Textbox
  • 3.56/5
Create a textbox user control that has a cut, copy, and paste event.

Fading Windows Form
  • 3.55/5
Create a Windows Form that fades in when the mouse hovers over it and fades out when the cursor leaves its bounds.

Dynamic Controls
  • 3.54/5
Work with dynamic controls in C#, including setting properties and attaching events.

Custom Shape Form - Transperancy
  • 3.48/5
Create Windows Forms that adapt to the shape of an imagine using a simple Form property. Custom shaped forms can be used to things such as creative splash screens.

Custom Shape Form - Region
  • 3.46/5
Create custom shaped forms but with the use of Regions. Regions allows for finer tuned behavior and can yield more stable results.

Animated Windows Forms
  • 3.45/5
Bring your C# applications to life with smooth consistent animations.

Windows 7 Style Form
  • 3.43/5
Create a Windows Form in C# that docks and snaps to the screen edges like in the upcoming Windows 7.

Virtual Forms
  • 3.42/5
How to use the TabControl .NET control to create virtual Forms inside WinForms.

Align User-Interface Programmatically
  • 3.22/5
Align the controls in your Windows Form programmatically instead of relying on design-time to keep a clean user-interface.

Bind Window to Screen
  • 3.2/5
Constrain a Windows Form to the bounds of the screen. Useful for preventing users from dragging a window outside of the bounded area.

Drop-Down Dialog
  • 3.2/5
Create an advanced dialog in C# to mimic the behavior of a drop-down list. Useful for user controls such as color pickers.

Prevent Form Close
  • 3.16/5
Learn how to prevent the user from closing a Windows Form.

Cross-Thread Operations
  • 3.12/5
Properly and elegantly make cross-thread operations using delegates.

Capture Control Graphics
  • 3.09/5
Capture the graphics of a visible .NET control to a bitmap using GDI.

Passing Data Between Forms
  • 3.07/5
How to pass data between Windows Forms in C# using parameters and properties of .NET classes.

Launch EXE from Memory
  • 2.99/5
Basics on how to launch a .NET application from memory using Reflection.

Image Button
  • 2.98/5
Add a great-looking C# image button to your .NET applications.

Password Textbox
  • 2.95/5
The two simplest ways to implement a C# Password Textbox.

Single-Instance Applications
  • 2.91/5
Write C# applications that support single-instance run-time behavior. Prevent users from running your program more than once at the same time.

Capture Screen (download now)
Use some more advanced C# programming to capture the screen without the use of the Prnt Scrn key.

Drag-and-Drop (download now)
The drag-and-drop functionality in C# programs is not as simple as it should be. Download this quick example to get a full working piece of source code to work from.

Screen Locker (download now)
In the internet you will find some fancy and expensive programs that can lock down your computer when you are away. In this project we will explore some fun brute-force techniques to create our very own screen locker application in C#.

Math

Hide Articles

Pick Random Elements Based on Probability
  • 3.72/5
Pick a random element in a C# list based on the probability of each element.

Rounding Doubles
  • 3.68/5
An explanation of how to round doubles in C# as well as the advantages of one method over another.

Decimal To Fraction
  • 3.65/5
A C# algorithm for approximating the fraction representation of decimal numbers.

Quadratic Formula Solver
  • 3.6/5
.NET implementation of the quadratic formula to solve quadratic equations. Algorithms for working with double and float types.

Greatest Common Denominator
  • 3.5/5
Efficiently find the Greatest Common Denominator (GCD) of two numbers in C# by using the Euclidean Algorithm.

Calculate Slope of Line
  • 3.32/5
Calculate the slope of a line defined by two points with simple C# operations.

Simplify Square Roots
  • 3.27/5
Use a C# algorithm to simplify complicated square roots into their simplest, most accurate, terms.

Boolean Matrix
  • 3.23/5
A C# implementation of a boolean matrix, complete with basic matrix operations and transformations.

Calculate Distance Formula
  • 3.17/5
Calculate the distance between two points using a C# function to process the distance formula.

Cryptography

Hide Articles

Compute Hash
  • 3.91/5
Compute the hash code of data in C# using .NET Framework classes.

Symmetric Encryption
  • 3.78/5
A description of symmetric encryption in C# to protect sensitive data. Overview of different symmetric encryption algorithms.

True Random Numbers
  • 3.67/5
Enhance your C# applications by giving them to ability to generate truly random numbers as opposed to pseudo-random ones.

SecureString
  • 3.2/5
Using the SecureString .NET class to manage sensitive data in C# applications.

Random String Generator
  • 3.12/5
Write a flexible C# random string generator without complex algorithms. Useful for things such as random password generators.

Xor Encryption
  • 2.85/5
Explore a simple way to encrypt string using the xor operator.

Self Hashing Application
  • 2.78/5
Find out how to create a C# application that can calculate its own hash value.

Encryption Class (download now)
Use this class of static methods to quickly encrypt and decrypt strings or directly a byte array. Encryption and decryption works based on a password.

Drawing GDI+

Hide Articles

Drawing Regular Polygons
  • 4.8/5
How to draw regular polygons in C# by calculating vertex coordinates and using GDI

Display GIF Animations
  • 3.91/5
Witness two simple methods to display animated images using only C# functions, accomplishing the task automatically or manually by accessing the animation frames.

Fast Image Processing
  • 3.81/5
How to work with images in .NET using unsafe C# code. Massively increases the speed of image processing algorithms.

Four-Point Image Distortion
  • 3.63/5
Distort a bitmap into any quadrilateral shape simply by specfiying the distinct locations of each of the corner points. All done in pure C# code.

Improved 3D Drawing with GDI-Plus
  • 3.56/5
Witness an improved 3D graphics GDI-Plus application. Built upon the original Euler 3D Rotation article, learn how to get around the Gimbal Lock problem and learn how to shade in 3D shapes in C#.

Box Blur
  • 3.54/5
Implementing a box blur effect in C# via image convolution.

Get Image Hash Code
  • 3.46/5
Simple approach to get the hash code of an image in C#.

Icon Extractor
  • 3.4/5
Use C# and some API calls to easily extract an application icon and use it within your own program.

Basic 3D Drawing with GDI-Plus
  • 3.4/5
Draw a basic 3D cube using only GDI-Plus without the need for DirectX.

Image Invert
  • 3.37/5
Invert an image colors in .NET with three different methods. Read the advatanges of each method.

Convert Color and uint
  • 3.33/5
Learn to convert between C# Color and uint variables. Helpful for working with Pointers in fast image processing.

Sorting 2D Points
  • 3.31/5
Sorting points can be an extremely useful algorithm. Image processing algorithms often if not always require points to have a certain order, this class will use the IComparer interface to sort points according to either the X or Y values.

Image Clip
  • 3.25/5
Fast simple image clipping code in C# using GDI to ensure speed and efficiency.

Hex to RGB
  • 3.2/5
Easily convert HTML hex colors to RGB colors in C#.

Image Rotate
  • 3.19/5
Rotate an image in C#.NET with only GDI , no need for complex bitmap rotation algorithms.

Image Zoom
  • 3.17/5
Create an application to zoom into image in C# by harnessing the power of GDI and C#.NET.

Draw Translucent Image
  • 3.12/5
Harness the power of GDI to draw translucent images without needing more complex image processing algorithms.

Draw Text Outline
  • 3.12/5
Draw the outline of any text, as opposed to the fill, using only GDI in C#.NET.

Image Flip
  • 3.11/5
Flip an image in C# with GDI and Matrix transformation, a simple yet powerful method for image transformation.

How to Load Image Files
  • 3.09/5
Learn the basics of opening an image file to a variable in C#.

Dominant Color in Image
  • 3.02/5
Calculate the overall dominant color in an image using a simple C# algorithm.

Image Noise Generator
  • 2.85/5
Generate an image with grayscale noise for a variety of different purposes using a simple C# algorithm.

Files and Data

Hide Articles

Scanning Through a Hard Drive
  • 4/5
A recursive approach to scanning through a harddrive in C#.

How to Create Strong-Type DataSet
  • 3.91/5
Improve data-handling in your C# applications through the use of strong-typed DataSets, whether your are developing SQL-enabled applications or simpler XML ones.

Uploading a File with FTP
  • 3.88/5
Easily upload a file through FTP using pure C#.

The C# Data Structures
  • 3.88/5
Explore the various built-in C# data structures and their applications in this three part article.

Dictionary
  • 3.69/5
A close look at the C# Dictionary and SortedDictionary data structures.

KeyValuePair
  • 3.66/5
Store pairs of values in with the C# KeyValuePair generic structure.

File Size From Bytes
  • 3.64/5
Learn how to convert a number of bytes into an estimated file size. File size is derived simply from a table of values.

Set DataGridView Selection
  • 3.62/5
How to set the row selected on a DataGridView control programmatically with C#.

Binary Searching a List
  • 3.58/5
Using binary search on a sorted .NET List or ArrayList to quickly find elements.

String Processing C# Functions Library
  • 3.56/5
Discover the possibilities of string processing in C#.NET. Expand upon the basic string functions provided by the .Net Framework.

Read Text File
  • 3.56/5
Find out how to read a text file in C# with the System.IO namespace. Read it all at once or by lines, both methods are explained.

Randomize Array List
  • 3.53/5
Discover how to randomize a list of items. Generate a new list where items are placed in random order.

Binary Search Tree
  • 3.46/5
C# Binary Search Tree is a simple data structure for fast searching of data.

Working with Relative Paths
  • 3.46/5
How to work with relative paths in C# WinForm applications.

Write a Binary File
  • 3.41/5
How to read and write a binary file in C# and some of its applications.

Palindrome String Function
  • 3.31/5
Use C# to check if a string is a palindrome or not using two different approaches.

Bucket Sort
  • 3.29/5
Bucket sort is a simple algorithm for sorting data in C#.

Priority Queue
  • 3.28/5
C# Priority Queue is a specialized Queue data structure. Useful in many applications and can be used for sorting data.

Partition List
  • 3.27/5
How to split a list in C# into smaller lists (or partitions). The concepts apply to .NET arrays as well.

Temporary Files
  • 3.27/5
Working with temporary files in C# with the IO namespace.

HashSet
  • 3.27/5
Overview of the new C# HashSet data structures along with some comparisons and benchmarks.

Faster Bucket Sort
  • 3.21/5
How to efficiently put the bucket sort algorithm in practice in C#.

Convert Array to String
  • 3.17/5
Convert any C# array to string with a single function. Supports generic and non-generic lists.

Iterators
  • 3.15/5
Explore the three C# iteration methods: for loop, foreach loop, and enumerators.

AVL Tree
  • 3.15/5
C# AVL Tree is a self-balancing binary tree designed to improve the running time of searching through data.

Image to Byte
  • 3.13/5
Learn two effective methods to convert an image in C# into a byte array.

Skip List
  • 2.96/5
C# Skip List is a powerful data structure that allows for fast searching of data.

String to Array
  • 2.95/5
Learn how to convert a string into an array in C#.NET.

Compress Data (download now)
Compress and decompress bytes on-the-fly with C# functions, no need for external libraries.

ASP.NET

Hide Articles

Ajax Control Toolkit
  • 4.08/5
Great place to start in expanding your collection of AJAX-enabled user controls.

ASP.NET MessageBox
  • 3.58/5
How to display a message box in ASP.Net using client-side code.

ASP.NET Web Hosting
  • 3.39/5
Read some points to consider when choosing an ASP.NET web hosting service for your web applications.

Web

Hide Articles

Download File FTP
  • 3.75/5
Enable your C# applications to connect to the internet to download files and webpages from an FTP Server with nothing but pure C#.Net code.

URL Checker
  • 3.74/5
Access a URL address with a simple C# application to determine the validity of a website link.

Javascript Multi-line String Utility
  • 3.67/5
A tool written in C# to transform multiple lines of text into a javascript-friendly multi-line string.

Download File HTTP
  • 3.59/5
Enable your C# applications to connect to the internet to download files and webpages using nothing but .Net Framework classes.

Extract Links
  • 3.25/5
Extract links from a webpage URL or HTML using some simple, elegant C# code.

Load Image from URL
  • 3.16/5
Load an image from a URL to memory, no need to save the image to the hard drive.

Launch C# Hyperlink
  • 3.15/5
Find out how to launch a hyperlink in C# using elements built-in the .Net Framework.

Encode URL
  • 3.12/5
Encode a URL string in C# easily for both ASP and desktop development.

HTML Emails with Gmail
  • 3.09/5
Send HTML emails in C# with .NET Framework classes, no need for external components.

Extract Images From URL
  • 2.7/5
Fetch all the images displayed on a webpage with C#.NET. Done by parsing the HTML code for image URLs.

Get Server Real-Time (download now)
Use C# to ask a web server for the actual current time. Useful for distribution applications and other time sensitive programs.

Miscellaneous

Hide Articles

Projo
  • 5/5
A look at an online project management tool called Projo.

Transform .NET Config Files Programmatically New
  • 5/5
Programmatically transform web.config and app.config files in C#

Compilr.com Online IDE
  • 4.71/5
Compilr.com is an online IDE for PHP, C, C++, Ruby and compiler for Java, C# and VB

jQuery Selector for Selenium WebDriver
  • 4.57/5
Add jQuery selectors to Selenium Webdriver in C# without modifying the Selenium server.

Enum to Readable String
  • 4.56/5
How to convert C# enums to readable strings and parse them back.

C# Read Embedded Resource New
  • 4.33/5
How to read embedded resources in C#.

Environment Properties
  • 4.14/5
Learn how to access common environment information through C#.NET.

Representing Graphs in C#
  • 4.11/5
Possible ways to represent a graph data-structure in C# to implement graph algorithms.

C# Extensions for Selenium WebDriver
  • 4.1/5
Short list of useful extension functions written in C# to enhance the functionality of Selenium 2 WebDriver

Question-Mark ? Operator
  • 3.72/5
Shorten conditionals in C# by using the ? operator.

Unique Hardware ID
  • 3.66/5
Obtaining a true hardware serial from a user computer can be tricky business. Luckily the .Net Framework provides the means to obtain a reliable ID which can in turn be used in licensing processes.

Credit Card Verification
  • 3.62/5
Quickly and easily verify credit card numbers in C# with the Luhn Algorithm. Works in desktop applications, ASP.NET, and mobile applications.

MS-Queue
  • 3.61/5
Access the MS-Queue Windows component through C# to create some interesting and powerful applications.

Application Optimizing Utility
  • 3.59/5
Test C# code segnments against each other to compare their performance speed.

Detect .NET Framework
  • 3.5/5
With the reliance of C#.NET on the .NET Framework, the ability to detect if the .NET Framework is installed on a computer can be quite useful. Check out a simple way to do it.

Assembly Custom Reference Path
  • 3.48/5
Find out how to specify to a C# application on what subfolders to locate C# libraries that contain essential execution code.

Request Google PageRank
  • 3.33/5
How to request the Google PageRank of a website through C#.

Create Instance From Type
  • 3.3/5
Create a new instance of an object from a reference to a .NET type.

Save TreeView State
  • 3.27/5
Save the state of a TreeView when it is cleared and repopulated. Very useful when working with dynamic data displayed on a TreeView control.

.NET Stock Images
  • 3.26/5
Discussion on stock images for developers along with some sample royalty-free stock images.

Code Region
  • 3.22/5
Format C# and .NET source code in Visual Studio with region code blocks. Combined with keyboard shortcuts and a little common sense, regions can format code to make it more readable.

Loop Time
  • 3.22/5
Make your applications run in circles for a specified amount of time without the need for a troublesome Timer control.

Get-Set Method Generator
  • 3.19/5
Automatically generate get-set methods in C# based on existing source code using simple text parsing.

Disk Drive
  • 3.17/5
Easily open and close multiple CD and DVD trays programmatically with C#.

Generate GUID
  • 3.17/5
How to generate a unique identifier, GUID, for use in all types of C# applications.

Action Lists
  • 3.13/5
Add ActionLists to C# controls to make properties and methods more accessible during design-time.

Access Properties by Name
  • 3.08/5
Use reflection to read and write to properties of .NET objects in C#.

Call Functions by Name
  • 3.03/5
Use reflection to call C# functions, including functions with parameters and return values.

C# Test Performance
  • 3.01/5
Test the speed of C# methods and algorithms with this extremely easy to use SpeedTester class, written entirely in C# for fast and simple integration.

Time Calculator (download now)
Add and subtract different times by switching between different time-formats used in C#.

Reading

Hide Articles

C# Programming Language of Choice
  • 3.69/5
Explore the advantages of the C#.Net programming language as a development platform for small and big applications.

7 Ways to Optimize C# Code
  • 3.67/5
Discover seven simple ways to improve the readability and performance of C# source code and applications.

Using Professional Icons
  • 3.46/5
Raise the presentation quality of your finished applications by adding icons. Read about tips for designing your own or for purchasing professional application icons.

Upgrading to Visual Studio
  • 3.33/5
Despite the potential of the Visual Studio Express editions, there can be numerous reasons to upgrade to the full version of Visual Studio, even for small-to-medium sized projects.

C# Component Guideline
  • 3.19/5
There are characteristics that a good C# component should have in order to make it worth selling. Here is a quick outline of some of those aspects.

Code Obfuscation
  • 2.97/5
Although C# applictions are vulnerable to code decompilation, there are methods to protect against it, one of which is code obfuscation.

XML Documentation
  • 2.95/5
Use the .NET built-in XML documentation support to quickly add documentation to your C# projects without major hassels.

All C# Articles and source code are under the Visual C# Kicks license agreement