Tag Archives: Windows Forms programming

Copy ListView data into an array in C#

This example uses the following ListView extension method to copy ListView data into a two-dimensional array of strings. // Return the ListBox’s contents in a string[,]. public static string[,] GetListViewData(this ListView lvw) { // Get the number of rows and … Continue reading

Posted in arrays, controls, strings | Tagged , , , , , , , , , , | Leave a comment

Draw the spiral of Theodorus in C#

The spiral of Theodorus (which is also called the square root spiral, Einstein spiral, and Pythagorean spiral) was first devised by the Greek mathematician Theodorus of Cyrene during the 5th century BC. The spiral consists of a sequence of right … Continue reading

Posted in algorithms, drawing, graphics, mathematics | Tagged , , , , , , , , , , , , , | Leave a comment

Add LINQ to autocomplete in C#

This example adds LINQ to the example Improve autocomplete suggestion in C#. It adds LINQ in two places: when it loads the list of words and when the program searches for the best matches that begin with a particular letter. … Continue reading

Posted in algorithms, LINQ, strings | Tagged , , , , , , , , , , , , , , | Leave a comment

Improve autocomplete suggestion in C#

This example improves on the example Suggest autocomplete words in C#. The previous example loads all of its words into a big array. Then, to find the words that start with a particular letter, the program uses a binary search … Continue reading

Posted in algorithms, strings | Tagged , , , , , , , , , , , , , , | 1 Comment

Suggest autocomplete words in C#

This example shows one way that a program can suggest words for the user. When I type something on my phone, it displays a list of possible words for autocomplete below the editing area. For example, if I type “gping” … Continue reading

Posted in algorithms, strings | Tagged , , , , , , , , , , , , , , | 5 Comments

Build an MRU list that uses project settings in C#

The post Build an MRU list in C# explains how to build an MRU list (most recently used list). That example stores recently used files in the system Registry. This example does the same thing but it stores file information … Continue reading

Posted in files, programs, registry | Tagged , , , , , , , , , , , , , | Leave a comment

Build an MRU list in C#

An MRU list (most recently used file list) displays in the File menu the files that a program has used most recently. If the user selects a file from the menu, the program reopens that file. This example builds an … Continue reading

Posted in files, programs, registry | Tagged , , , , , , , , , , , , , | 3 Comments

Useful tools and links

This page lists some useful tools and links that I visit regularly. If you want to recommend others, please post them in the comments. Tools Programming Sites Forums Tools @icon sushi Image to icon converter that supports the mask editor … Continue reading

Posted in miscellany, tools | Tagged , , , , , , , , | Leave a comment

Get information about Windows shortcuts in C#

This post explains how to get information about Windows shortcuts. The post has two parts. The first explains how to get the information. The second explains how to create shortcuts. Getting Shortcut Information This example uses the following GetShortcutInfo method … Continue reading

Posted in system | Tagged , , , , , , , , , | 3 Comments

List the shortcuts in the computer’s network neighborhood in C#

This example uses the Windows Script Host to list shortcuts in the network neighborhood. Before the program can use the Windows Script Host, you must add a reference to the COM object “Windows Script Host Object Model.” To make using … Continue reading

Posted in miscellany, network | Tagged , , , , , , , , , , , | 2 Comments