Tag Archives: C# programming

Quick tip: Use pinvoke.net to get information about API functions for use in C#

Platform Invocation Services (pinvoke) lets allows managed .NET code call unmanaged API functions that are implemented in a DLL. The functions in a DLL are exposed via an Application Programming Interface (API). The enormous .NET runtime library wraps many API … Continue reading

Posted in API | Tagged , , , , , , , , , , | Leave a comment

Find Visual Studio’s Immediate window

For some reason, the Immediate window seems to be a never-ending subject for Microsoft treasure hunts. It seems like each new release of Visual Studio moves the Immediate window to a new location buried deep within the menu hierarchy. In … Continue reading

Posted in IDE, Windows Forms programming | Tagged , , , , , , , | Leave a comment

Map device coordinates to world coordinates in C#

Sometimes it’s convenient to draw in one coordinate system (called world coordinates) and map those coordinates to the screen’s device coordinates. The example Map points between coordinate systems in C# shows how to do this in C#. For example, the … Continue reading

Posted in drawing, graphics, transformations | Tagged , , , , , , , , , , | Leave a comment

How to send an SMS text message in C#

This example finishes the series showing how to make a C# program send an SMS (Short Message Service) message. You could use this technique to make a program monitor some sort of ongoing process and send you a message if … Continue reading

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

Calculate credit payments in WPF and C#

This is a WPF version of the example Calculate credit payments in C#. The calculations are the same. Unfortunately building and using the user interface is much harder in WPF, particularly working with the ListView control. (The unofficial WPF slogan: … Continue reading

Posted in algorithms, calculations, finance, mathematics | Tagged , , , , , , , , , , , , , | Leave a comment

Extract part of a JSON file in C#

This example shows how to read a JSON file and pick out only the pieces that are interesting. Recall from my post Anatomy of an example that my original goal with this series of articles was to write a program … Continue reading

Posted in algorithms, files, serialization | Tagged , , , , , , , , , , , , , | 1 Comment

Write a TreeView into a tab-delimited file in C#

The example Load a TreeView from a tab-delimited file in C# shows how to load a TreeView control from a file. This example shows how to do the converse: write a TreeView control’s values into a file. The following SaveTreeViewIntoFile … Continue reading

Posted in algorithms, controls, files, recursion | Tagged , , , , , , , , , , , | Leave a comment

Use JSON to serialize and deserialize objects in C#

JSON (JavaScript Object Notation) is a standard for textual storage and interchange of information, much as XML is. Before you roll your eyes and ask if we really need another language to do what XML does, consider how verbose XML … Continue reading

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

Display tooltips on a graph of an equation entered by the user in C#

This example draws a graph of an equation entered by the user and the displays a tooltip on it when you move the mouse over the graph. See the post Graph equations entered by the user in C# for information … Continue reading

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

Download and display a text file whenever a program starts in C#

When this example starts, it downloads a file from the internet and displays it. You could do something similar to display a message of the day or announcements for your program. The program uses the following Load event handler to … Continue reading

Posted in files, internet, web | Tagged , , , , , , , , , | Leave a comment